rename xgboosterror
This commit is contained in:
@@ -31,7 +31,7 @@ import org.dmlc.xgboost4j.DMatrix;
|
||||
import org.dmlc.xgboost4j.demo.util.DataLoader;
|
||||
import org.dmlc.xgboost4j.demo.util.Params;
|
||||
import org.dmlc.xgboost4j.util.Trainer;
|
||||
import org.dmlc.xgboost4j.util.XgboostError;
|
||||
import org.dmlc.xgboost4j.util.XGBoostError;
|
||||
|
||||
/**
|
||||
* a simple example of java wrapper for xgboost
|
||||
@@ -53,7 +53,7 @@ public class BasicWalkThrough {
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) throws UnsupportedEncodingException, IOException, XgboostError {
|
||||
public static void main(String[] args) throws UnsupportedEncodingException, IOException, XGBoostError {
|
||||
// load file from text file, also binary buffer generated by xgboost4j
|
||||
DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train");
|
||||
DMatrix testMat = new DMatrix("../../demo/data/agaricus.txt.test");
|
||||
|
||||
@@ -23,14 +23,14 @@ import org.dmlc.xgboost4j.Booster;
|
||||
import org.dmlc.xgboost4j.DMatrix;
|
||||
import org.dmlc.xgboost4j.demo.util.Params;
|
||||
import org.dmlc.xgboost4j.util.Trainer;
|
||||
import org.dmlc.xgboost4j.util.XgboostError;
|
||||
import org.dmlc.xgboost4j.util.XGBoostError;
|
||||
|
||||
/**
|
||||
* example for start from a initial base prediction
|
||||
* @author hzx
|
||||
*/
|
||||
public class BoostFromPrediction {
|
||||
public static void main(String[] args) throws XgboostError {
|
||||
public static void main(String[] args) throws XGBoostError {
|
||||
System.out.println("start running example to start from a initial prediction");
|
||||
|
||||
// load file from text file, also binary buffer generated by xgboost4j
|
||||
|
||||
@@ -19,14 +19,14 @@ import java.io.IOException;
|
||||
import org.dmlc.xgboost4j.DMatrix;
|
||||
import org.dmlc.xgboost4j.util.Trainer;
|
||||
import org.dmlc.xgboost4j.demo.util.Params;
|
||||
import org.dmlc.xgboost4j.util.XgboostError;
|
||||
import org.dmlc.xgboost4j.util.XGBoostError;
|
||||
|
||||
/**
|
||||
* an example of cross validation
|
||||
* @author hzx
|
||||
*/
|
||||
public class CrossValidation {
|
||||
public static void main(String[] args) throws IOException, XgboostError {
|
||||
public static void main(String[] args) throws IOException, XGBoostError {
|
||||
//load train mat
|
||||
DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train");
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.dmlc.xgboost4j.DMatrix;
|
||||
import org.dmlc.xgboost4j.IObjective;
|
||||
import org.dmlc.xgboost4j.demo.util.Params;
|
||||
import org.dmlc.xgboost4j.util.Trainer;
|
||||
import org.dmlc.xgboost4j.util.XgboostError;
|
||||
import org.dmlc.xgboost4j.util.XGBoostError;
|
||||
|
||||
/**
|
||||
* an example user define objective and eval
|
||||
@@ -74,7 +74,7 @@ public class CustomObjective {
|
||||
float[] labels;
|
||||
try {
|
||||
labels = dtrain.getLabel();
|
||||
} catch (XgboostError ex) {
|
||||
} catch (XGBoostError ex) {
|
||||
logger.error(ex);
|
||||
return null;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ public class CustomObjective {
|
||||
float[] labels;
|
||||
try {
|
||||
labels = dmat.getLabel();
|
||||
} catch (XgboostError ex) {
|
||||
} catch (XGBoostError ex) {
|
||||
logger.error(ex);
|
||||
return -1f;
|
||||
}
|
||||
@@ -140,7 +140,7 @@ public class CustomObjective {
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws XgboostError {
|
||||
public static void main(String[] args) throws XGBoostError {
|
||||
//load train mat (svmlight format)
|
||||
DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train");
|
||||
//load valid mat (svmlight format)
|
||||
|
||||
@@ -23,14 +23,14 @@ import org.dmlc.xgboost4j.Booster;
|
||||
import org.dmlc.xgboost4j.DMatrix;
|
||||
import org.dmlc.xgboost4j.demo.util.Params;
|
||||
import org.dmlc.xgboost4j.util.Trainer;
|
||||
import org.dmlc.xgboost4j.util.XgboostError;
|
||||
import org.dmlc.xgboost4j.util.XGBoostError;
|
||||
|
||||
/**
|
||||
* simple example for using external memory version
|
||||
* @author hzx
|
||||
*/
|
||||
public class ExternalMemory {
|
||||
public static void main(String[] args) throws XgboostError {
|
||||
public static void main(String[] args) throws XGBoostError {
|
||||
//this is the only difference, add a # followed by a cache prefix name
|
||||
//several cache file with the prefix will be generated
|
||||
//currently only support convert from libsvm file
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.dmlc.xgboost4j.DMatrix;
|
||||
import org.dmlc.xgboost4j.demo.util.CustomEval;
|
||||
import org.dmlc.xgboost4j.demo.util.Params;
|
||||
import org.dmlc.xgboost4j.util.Trainer;
|
||||
import org.dmlc.xgboost4j.util.XgboostError;
|
||||
import org.dmlc.xgboost4j.util.XGBoostError;
|
||||
|
||||
/**
|
||||
* this is an example of fit generalized linear model in xgboost
|
||||
@@ -32,7 +32,7 @@ import org.dmlc.xgboost4j.util.XgboostError;
|
||||
* @author hzx
|
||||
*/
|
||||
public class GeneralizedLinearModel {
|
||||
public static void main(String[] args) throws XgboostError {
|
||||
public static void main(String[] args) throws XGBoostError {
|
||||
// load file from text file, also binary buffer generated by xgboost4j
|
||||
DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train");
|
||||
DMatrix testMat = new DMatrix("../../demo/data/agaricus.txt.test");
|
||||
|
||||
@@ -25,14 +25,14 @@ import org.dmlc.xgboost4j.util.Trainer;
|
||||
|
||||
import org.dmlc.xgboost4j.demo.util.CustomEval;
|
||||
import org.dmlc.xgboost4j.demo.util.Params;
|
||||
import org.dmlc.xgboost4j.util.XgboostError;
|
||||
import org.dmlc.xgboost4j.util.XGBoostError;
|
||||
|
||||
/**
|
||||
* predict first ntree
|
||||
* @author hzx
|
||||
*/
|
||||
public class PredictFirstNtree {
|
||||
public static void main(String[] args) throws XgboostError {
|
||||
public static void main(String[] args) throws XGBoostError {
|
||||
// load file from text file, also binary buffer generated by xgboost4j
|
||||
DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train");
|
||||
DMatrix testMat = new DMatrix("../../demo/data/agaricus.txt.test");
|
||||
|
||||
@@ -24,14 +24,14 @@ import org.dmlc.xgboost4j.Booster;
|
||||
import org.dmlc.xgboost4j.DMatrix;
|
||||
import org.dmlc.xgboost4j.util.Trainer;
|
||||
import org.dmlc.xgboost4j.demo.util.Params;
|
||||
import org.dmlc.xgboost4j.util.XgboostError;
|
||||
import org.dmlc.xgboost4j.util.XGBoostError;
|
||||
|
||||
/**
|
||||
* predict leaf indices
|
||||
* @author hzx
|
||||
*/
|
||||
public class PredictLeafIndices {
|
||||
public static void main(String[] args) throws XgboostError {
|
||||
public static void main(String[] args) throws XGBoostError {
|
||||
// load file from text file, also binary buffer generated by xgboost4j
|
||||
DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train");
|
||||
DMatrix testMat = new DMatrix("../../demo/data/agaricus.txt.test");
|
||||
|
||||
@@ -19,7 +19,7 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.dmlc.xgboost4j.DMatrix;
|
||||
import org.dmlc.xgboost4j.IEvaluation;
|
||||
import org.dmlc.xgboost4j.util.XgboostError;
|
||||
import org.dmlc.xgboost4j.util.XGBoostError;
|
||||
|
||||
/**
|
||||
* a util evaluation class for examples
|
||||
@@ -41,7 +41,7 @@ public class CustomEval implements IEvaluation {
|
||||
float[] labels;
|
||||
try {
|
||||
labels = dmat.getLabel();
|
||||
} catch (XgboostError ex) {
|
||||
} catch (XGBoostError ex) {
|
||||
logger.error(ex);
|
||||
return -1f;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user