biz.k11i.xgboost.learner.ObjFunction Java Examples

The following examples show how to use biz.k11i.xgboost.learner.ObjFunction. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Predictor.java    From xgboost-predictor-java with Apache License 2.0 5 votes vote down vote up
void initObjFunction(PredictorConfiguration configuration) {
    obj = configuration.getObjFunction();

    if (obj == null) {
        obj = ObjFunction.fromName(name_obj);
    }
}
 
Example #2
Source File: GBPredictorTestBase.java    From xgboost-predictor-java with Apache License 2.0 5 votes vote down vote up
@Theory
public void testPredict(
        TestParameter parameter,
        PredictorConfiguration configuration,
        boolean useJafama) throws IOException {

    ObjFunction.useFastMathExp(useJafama);

    verify(
            parameter.predictionModel(configuration),
            parameter.testData(),
            parameter.expectation(),
            parameter.task);
}
 
Example #3
Source File: XGBoostEvidenceFilter.java    From gatk with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public static Predictor loadPredictor(final String modelFileLocation) {
    ObjFunction.useFastMathExp(USE_FAST_MATH_EXP);
    try(final InputStream inputStream = modelFileLocation == null ?
            resourcePathToInputStream(DEFAULT_PREDICTOR_RESOURCE_PATH) : BucketUtils.openFile(modelFileLocation)) {
        return new Predictor(inputStream);
    } catch(Exception e) {
        throw new GATKException(
                "Unable to load predictor from classifier file "
                        + (modelFileLocation == null ? DEFAULT_PREDICTOR_RESOURCE_PATH : modelFileLocation)
                        + ": " + e.getMessage()
        );
    }
}
 
Example #4
Source File: Predictor.java    From Myna with Apache License 2.0 4 votes vote down vote up
private void initObjGbm() {
    obj = ObjFunction.fromName(name_obj);
    gbm = GradBooster.Factory.createGradBooster(name_gbm);
    gbm.setNumClass(mparam.num_class);
}
 
Example #5
Source File: PredictorConfiguration.java    From xgboost-predictor-java with Apache License 2.0 4 votes vote down vote up
public ObjFunction getObjFunction() {
    return objFunction;
}
 
Example #6
Source File: Predictor.java    From xgboost-predictor-java with Apache License 2.0 4 votes vote down vote up
void initObjGbm() {
    obj = ObjFunction.fromName(name_obj);
    gbm = GradBooster.Factory.createGradBooster(name_gbm);
    gbm.setNumClass(mparam.num_class);
}
 
Example #7
Source File: DartPredictorTest.java    From xgboost-predictor-java with Apache License 2.0 4 votes vote down vote up
@After
public void tearDown() {
    ObjFunction.useFastMathExp(false);
}
 
Example #8
Source File: GBLinearPredictorTest.java    From xgboost-predictor-java with Apache License 2.0 4 votes vote down vote up
@After
public void tearDown() {
    ObjFunction.useFastMathExp(false);
}
 
Example #9
Source File: GBTreePredictorTest.java    From xgboost-predictor-java with Apache License 2.0 4 votes vote down vote up
@After
public void tearDown() {
    ObjFunction.useFastMathExp(false);
}
 
Example #10
Source File: GBPredictorTestBase.java    From xgboost-predictor-java with Apache License 2.0 4 votes vote down vote up
@After
public void tearDown() {
    ObjFunction.useFastMathExp(false);
}