Java Code Examples for biz.k11i.xgboost.util.FVec#fvalue()

The following examples show how to use biz.k11i.xgboost.util.FVec#fvalue() . 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: GBLinear.java    From Myna with Apache License 2.0 5 votes vote down vote up
double pred(FVec feat, int gid) {
    double psum = bias(gid);
    double featValue;
    for (int fid = 0; fid < mparam.num_feature; ++fid) {
        featValue = feat.fvalue(fid);
        if (!Double.isNaN(featValue)) {
            psum += featValue * weight(fid, gid);
        }
    }
    return psum;
}
 
Example 2
Source File: RegTree.java    From Myna with Apache License 2.0 5 votes vote down vote up
int next(FVec feat) {
    double fvalue = feat.fvalue(_splitIndex);
    if (fvalue != fvalue) {  // is NaN?
        return _defaultNext;
    }
    return (fvalue < split_cond) ? cleft_ : cright_;
}
 
Example 3
Source File: GBLinear.java    From xgboost-predictor-java with Apache License 2.0 5 votes vote down vote up
double pred(FVec feat, int gid) {
    double psum = bias(gid);
    double featValue;
    for (int fid = 0; fid < mparam.num_feature; ++fid) {
        featValue = feat.fvalue(fid);
        if (!Double.isNaN(featValue)) {
            psum += featValue * weight(fid, gid);
        }
    }
    return psum;
}
 
Example 4
Source File: RegTree.java    From xgboost-predictor-java with Apache License 2.0 5 votes vote down vote up
int next(FVec feat) {
    double fvalue = feat.fvalue(_splitIndex);
    if (fvalue != fvalue) {  // is NaN?
        return _defaultNext;
    }
    return (fvalue < split_cond) ? cleft_ : cright_;
}