Fix native/Native consistency in comments
This commit is contained in:
parent
fd3baf68f1
commit
375c106fcc
@ -59,7 +59,7 @@ public final class Booster {
|
|||||||
* init Booster from dMatrixs
|
* init Booster from dMatrixs
|
||||||
* @param params parameters
|
* @param params parameters
|
||||||
* @param dMatrixs DMatrix array
|
* @param dMatrixs DMatrix array
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public Booster(Iterable<Entry<String, Object>> params, DMatrix[] dMatrixs) throws XGBoostError {
|
public Booster(Iterable<Entry<String, Object>> params, DMatrix[] dMatrixs) throws XGBoostError {
|
||||||
init(dMatrixs);
|
init(dMatrixs);
|
||||||
@ -73,7 +73,7 @@ public final class Booster {
|
|||||||
* load model from modelPath
|
* load model from modelPath
|
||||||
* @param params parameters
|
* @param params parameters
|
||||||
* @param modelPath booster modelPath (model generated by booster.saveModel)
|
* @param modelPath booster modelPath (model generated by booster.saveModel)
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public Booster(Iterable<Entry<String, Object>> params, String modelPath) throws XGBoostError {
|
public Booster(Iterable<Entry<String, Object>> params, String modelPath) throws XGBoostError {
|
||||||
init(null);
|
init(null);
|
||||||
@ -103,7 +103,7 @@ public final class Booster {
|
|||||||
* set parameter
|
* set parameter
|
||||||
* @param key param name
|
* @param key param name
|
||||||
* @param value param value
|
* @param value param value
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public final void setParam(String key, String value) throws XGBoostError {
|
public final void setParam(String key, String value) throws XGBoostError {
|
||||||
ErrorHandle.checkCall(XgboostJNI.XGBoosterSetParam(handle, key, value));
|
ErrorHandle.checkCall(XgboostJNI.XGBoosterSetParam(handle, key, value));
|
||||||
@ -112,7 +112,7 @@ public final class Booster {
|
|||||||
/**
|
/**
|
||||||
* set parameters
|
* set parameters
|
||||||
* @param params parameters key-value map
|
* @param params parameters key-value map
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public void setParams(Iterable<Entry<String, Object>> params) throws XGBoostError {
|
public void setParams(Iterable<Entry<String, Object>> params) throws XGBoostError {
|
||||||
if(params!=null) {
|
if(params!=null) {
|
||||||
@ -127,7 +127,7 @@ public final class Booster {
|
|||||||
* Update (one iteration)
|
* Update (one iteration)
|
||||||
* @param dtrain training data
|
* @param dtrain training data
|
||||||
* @param iter current iteration number
|
* @param iter current iteration number
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public void update(DMatrix dtrain, int iter) throws XGBoostError {
|
public void update(DMatrix dtrain, int iter) throws XGBoostError {
|
||||||
ErrorHandle.checkCall(XgboostJNI.XGBoosterUpdateOneIter(handle, iter, dtrain.getHandle()));
|
ErrorHandle.checkCall(XgboostJNI.XGBoosterUpdateOneIter(handle, iter, dtrain.getHandle()));
|
||||||
@ -138,7 +138,7 @@ public final class Booster {
|
|||||||
* @param dtrain training data
|
* @param dtrain training data
|
||||||
* @param iter current iteration number
|
* @param iter current iteration number
|
||||||
* @param obj customized objective class
|
* @param obj customized objective class
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public void update(DMatrix dtrain, int iter, IObjective obj) throws XGBoostError {
|
public void update(DMatrix dtrain, int iter, IObjective obj) throws XGBoostError {
|
||||||
float[][] predicts = predict(dtrain, true);
|
float[][] predicts = predict(dtrain, true);
|
||||||
@ -151,7 +151,7 @@ public final class Booster {
|
|||||||
* @param dtrain training data
|
* @param dtrain training data
|
||||||
* @param grad first order of gradient
|
* @param grad first order of gradient
|
||||||
* @param hess seconde order of gradient
|
* @param hess seconde order of gradient
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public void boost(DMatrix dtrain, float[] grad, float[] hess) throws XGBoostError {
|
public void boost(DMatrix dtrain, float[] grad, float[] hess) throws XGBoostError {
|
||||||
if(grad.length != hess.length) {
|
if(grad.length != hess.length) {
|
||||||
@ -166,7 +166,7 @@ public final class Booster {
|
|||||||
* @param evalNames name for eval dmatrixs, used for check results
|
* @param evalNames name for eval dmatrixs, used for check results
|
||||||
* @param iter current eval iteration
|
* @param iter current eval iteration
|
||||||
* @return eval information
|
* @return eval information
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public String evalSet(DMatrix[] evalMatrixs, String[] evalNames, int iter) throws XGBoostError {
|
public String evalSet(DMatrix[] evalMatrixs, String[] evalNames, int iter) throws XGBoostError {
|
||||||
long[] handles = dMatrixs2handles(evalMatrixs);
|
long[] handles = dMatrixs2handles(evalMatrixs);
|
||||||
@ -182,7 +182,7 @@ public final class Booster {
|
|||||||
* @param iter number of interations
|
* @param iter number of interations
|
||||||
* @param eval custom evaluator
|
* @param eval custom evaluator
|
||||||
* @return eval information
|
* @return eval information
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public String evalSet(DMatrix[] evalMatrixs, String[] evalNames, int iter, IEvaluation eval) throws XGBoostError {
|
public String evalSet(DMatrix[] evalMatrixs, String[] evalNames, int iter, IEvaluation eval) throws XGBoostError {
|
||||||
String evalInfo = "";
|
String evalInfo = "";
|
||||||
@ -202,7 +202,7 @@ public final class Booster {
|
|||||||
* @param evalNames name for eval dmatrixs, used for check results
|
* @param evalNames name for eval dmatrixs, used for check results
|
||||||
* @param iter current eval iteration
|
* @param iter current eval iteration
|
||||||
* @return eval information
|
* @return eval information
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public String evalSet(long[] dHandles, String[] evalNames, int iter) throws XGBoostError {
|
public String evalSet(long[] dHandles, String[] evalNames, int iter) throws XGBoostError {
|
||||||
String[] evalInfo = new String[1];
|
String[] evalInfo = new String[1];
|
||||||
@ -217,7 +217,7 @@ public final class Booster {
|
|||||||
* @param evalName evaluation name
|
* @param evalName evaluation name
|
||||||
* @param iter number of iterations
|
* @param iter number of iterations
|
||||||
* @return eval information
|
* @return eval information
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public String eval(DMatrix evalMat, String evalName, int iter) throws XGBoostError {
|
public String eval(DMatrix evalMat, String evalName, int iter) throws XGBoostError {
|
||||||
DMatrix[] evalMats = new DMatrix[] {evalMat};
|
DMatrix[] evalMats = new DMatrix[] {evalMat};
|
||||||
@ -259,7 +259,7 @@ public final class Booster {
|
|||||||
* Predict with data
|
* Predict with data
|
||||||
* @param data dmatrix storing the input
|
* @param data dmatrix storing the input
|
||||||
* @return predict result
|
* @return predict result
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public float[][] predict(DMatrix data) throws XGBoostError {
|
public float[][] predict(DMatrix data) throws XGBoostError {
|
||||||
return pred(data, false, 0, false);
|
return pred(data, false, 0, false);
|
||||||
@ -270,7 +270,7 @@ public final class Booster {
|
|||||||
* @param data dmatrix storing the input
|
* @param data dmatrix storing the input
|
||||||
* @param outPutMargin Whether to output the raw untransformed margin value.
|
* @param outPutMargin Whether to output the raw untransformed margin value.
|
||||||
* @return predict result
|
* @return predict result
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public float[][] predict(DMatrix data, boolean outPutMargin) throws XGBoostError {
|
public float[][] predict(DMatrix data, boolean outPutMargin) throws XGBoostError {
|
||||||
return pred(data, outPutMargin, 0, false);
|
return pred(data, outPutMargin, 0, false);
|
||||||
@ -282,7 +282,7 @@ public final class Booster {
|
|||||||
* @param outPutMargin Whether to output the raw untransformed margin value.
|
* @param outPutMargin Whether to output the raw untransformed margin value.
|
||||||
* @param treeLimit Limit number of trees in the prediction; defaults to 0 (use all trees).
|
* @param treeLimit Limit number of trees in the prediction; defaults to 0 (use all trees).
|
||||||
* @return predict result
|
* @return predict result
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public float[][] predict(DMatrix data, boolean outPutMargin, int treeLimit) throws XGBoostError {
|
public float[][] predict(DMatrix data, boolean outPutMargin, int treeLimit) throws XGBoostError {
|
||||||
return pred(data, outPutMargin, treeLimit, false);
|
return pred(data, outPutMargin, treeLimit, false);
|
||||||
@ -297,7 +297,7 @@ public final class Booster {
|
|||||||
Note that the leaf index of a tree is unique per tree, so you may find leaf 1
|
Note that the leaf index of a tree is unique per tree, so you may find leaf 1
|
||||||
in both tree 1 and tree 0.
|
in both tree 1 and tree 0.
|
||||||
* @return predict result
|
* @return predict result
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public float[][] predict(DMatrix data , int treeLimit, boolean predLeaf) throws XGBoostError {
|
public float[][] predict(DMatrix data , int treeLimit, boolean predLeaf) throws XGBoostError {
|
||||||
return pred(data, false, treeLimit, predLeaf);
|
return pred(data, false, treeLimit, predLeaf);
|
||||||
@ -319,7 +319,7 @@ public final class Booster {
|
|||||||
* get the dump of the model as a string array
|
* get the dump of the model as a string array
|
||||||
* @param withStats Controls whether the split statistics are output.
|
* @param withStats Controls whether the split statistics are output.
|
||||||
* @return dumped model information
|
* @return dumped model information
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public String[] getDumpInfo(boolean withStats) throws XGBoostError {
|
public String[] getDumpInfo(boolean withStats) throws XGBoostError {
|
||||||
int statsFlag = 0;
|
int statsFlag = 0;
|
||||||
@ -336,7 +336,7 @@ public final class Booster {
|
|||||||
* @param featureMap featureMap file
|
* @param featureMap featureMap file
|
||||||
* @param withStats Controls whether the split statistics are output.
|
* @param withStats Controls whether the split statistics are output.
|
||||||
* @return dumped model information
|
* @return dumped model information
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public String[] getDumpInfo(String featureMap, boolean withStats) throws XGBoostError {
|
public String[] getDumpInfo(String featureMap, boolean withStats) throws XGBoostError {
|
||||||
int statsFlag = 0;
|
int statsFlag = 0;
|
||||||
@ -356,7 +356,7 @@ public final class Booster {
|
|||||||
* @throws FileNotFoundException file not found
|
* @throws FileNotFoundException file not found
|
||||||
* @throws UnsupportedEncodingException unsupported feature
|
* @throws UnsupportedEncodingException unsupported feature
|
||||||
* @throws IOException error with model writing
|
* @throws IOException error with model writing
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public void dumpModel(String modelPath, boolean withStats) throws FileNotFoundException, UnsupportedEncodingException, IOException, XGBoostError {
|
public void dumpModel(String modelPath, boolean withStats) throws FileNotFoundException, UnsupportedEncodingException, IOException, XGBoostError {
|
||||||
File tf = new File(modelPath);
|
File tf = new File(modelPath);
|
||||||
@ -383,7 +383,7 @@ public final class Booster {
|
|||||||
* @throws FileNotFoundException exception
|
* @throws FileNotFoundException exception
|
||||||
* @throws UnsupportedEncodingException exception
|
* @throws UnsupportedEncodingException exception
|
||||||
* @throws IOException exception
|
* @throws IOException exception
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public void dumpModel(String modelPath, String featureMap, boolean withStats) throws FileNotFoundException, UnsupportedEncodingException, IOException, XGBoostError {
|
public void dumpModel(String modelPath, String featureMap, boolean withStats) throws FileNotFoundException, UnsupportedEncodingException, IOException, XGBoostError {
|
||||||
File tf = new File(modelPath);
|
File tf = new File(modelPath);
|
||||||
@ -404,7 +404,7 @@ public final class Booster {
|
|||||||
/**
|
/**
|
||||||
* get importance of each feature
|
* get importance of each feature
|
||||||
* @return featureMap key: feature index, value: feature importance score
|
* @return featureMap key: feature index, value: feature importance score
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public Map<String, Integer> getFeatureScore() throws XGBoostError {
|
public Map<String, Integer> getFeatureScore() throws XGBoostError {
|
||||||
String[] modelInfos = getDumpInfo(false);
|
String[] modelInfos = getDumpInfo(false);
|
||||||
@ -433,7 +433,7 @@ public final class Booster {
|
|||||||
* get importance of each feature
|
* get importance of each feature
|
||||||
* @param featureMap file to save dumped model info
|
* @param featureMap file to save dumped model info
|
||||||
* @return featureMap key: feature index, value: feature importance score
|
* @return featureMap key: feature index, value: feature importance score
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public Map<String, Integer> getFeatureScore(String featureMap) throws XGBoostError {
|
public Map<String, Integer> getFeatureScore(String featureMap) throws XGBoostError {
|
||||||
String[] modelInfos = getDumpInfo(featureMap, false);
|
String[] modelInfos = getDumpInfo(featureMap, false);
|
||||||
|
|||||||
@ -52,7 +52,7 @@ public class DMatrix {
|
|||||||
/**
|
/**
|
||||||
* init DMatrix from file (svmlight format)
|
* init DMatrix from file (svmlight format)
|
||||||
* @param dataPath path of data file
|
* @param dataPath path of data file
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public DMatrix(String dataPath) throws XGBoostError {
|
public DMatrix(String dataPath) throws XGBoostError {
|
||||||
if(dataPath == null) {
|
if(dataPath == null) {
|
||||||
@ -69,7 +69,7 @@ public class DMatrix {
|
|||||||
* @param indices Indices (colIndexs for CSR or rowIndexs for CSC)
|
* @param indices Indices (colIndexs for CSR or rowIndexs for CSC)
|
||||||
* @param data non zero values (sequence by row for CSR or by col for CSC)
|
* @param data non zero values (sequence by row for CSR or by col for CSC)
|
||||||
* @param st sparse matrix type (CSR or CSC)
|
* @param st sparse matrix type (CSR or CSC)
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public DMatrix(long[] headers, int[] indices, float[] data, SparseType st) throws XGBoostError {
|
public DMatrix(long[] headers, int[] indices, float[] data, SparseType st) throws XGBoostError {
|
||||||
long[] out = new long[1];
|
long[] out = new long[1];
|
||||||
@ -130,7 +130,7 @@ public class DMatrix {
|
|||||||
* if specified, xgboost will start from this init margin
|
* if specified, xgboost will start from this init margin
|
||||||
* can be used to specify initial prediction to boost from
|
* can be used to specify initial prediction to boost from
|
||||||
* @param baseMargin base margin
|
* @param baseMargin base margin
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public void setBaseMargin(float[] baseMargin) throws XGBoostError {
|
public void setBaseMargin(float[] baseMargin) throws XGBoostError {
|
||||||
ErrorHandle.checkCall(XgboostJNI.XGDMatrixSetFloatInfo(handle, "base_margin", baseMargin));
|
ErrorHandle.checkCall(XgboostJNI.XGDMatrixSetFloatInfo(handle, "base_margin", baseMargin));
|
||||||
@ -140,7 +140,7 @@ public class DMatrix {
|
|||||||
* if specified, xgboost will start from this init margin
|
* if specified, xgboost will start from this init margin
|
||||||
* can be used to specify initial prediction to boost from
|
* can be used to specify initial prediction to boost from
|
||||||
* @param baseMargin base margin
|
* @param baseMargin base margin
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public void setBaseMargin(float[][] baseMargin) throws XGBoostError {
|
public void setBaseMargin(float[][] baseMargin) throws XGBoostError {
|
||||||
float[] flattenMargin = flatten(baseMargin);
|
float[] flattenMargin = flatten(baseMargin);
|
||||||
@ -150,7 +150,7 @@ public class DMatrix {
|
|||||||
/**
|
/**
|
||||||
* Set group sizes of DMatrix (used for ranking)
|
* Set group sizes of DMatrix (used for ranking)
|
||||||
* @param group group size as array
|
* @param group group size as array
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public void setGroup(int[] group) throws XGBoostError {
|
public void setGroup(int[] group) throws XGBoostError {
|
||||||
ErrorHandle.checkCall(XgboostJNI.XGDMatrixSetGroup(handle, group));
|
ErrorHandle.checkCall(XgboostJNI.XGDMatrixSetGroup(handle, group));
|
||||||
@ -171,7 +171,7 @@ public class DMatrix {
|
|||||||
/**
|
/**
|
||||||
* get label values
|
* get label values
|
||||||
* @return label
|
* @return label
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public float[] getLabel() throws XGBoostError {
|
public float[] getLabel() throws XGBoostError {
|
||||||
return getFloatInfo("label");
|
return getFloatInfo("label");
|
||||||
@ -180,7 +180,7 @@ public class DMatrix {
|
|||||||
/**
|
/**
|
||||||
* get weight of the DMatrix
|
* get weight of the DMatrix
|
||||||
* @return weights
|
* @return weights
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public float[] getWeight() throws XGBoostError {
|
public float[] getWeight() throws XGBoostError {
|
||||||
return getFloatInfo("weight");
|
return getFloatInfo("weight");
|
||||||
@ -189,7 +189,7 @@ public class DMatrix {
|
|||||||
/**
|
/**
|
||||||
* get base margin of the DMatrix
|
* get base margin of the DMatrix
|
||||||
* @return base margin
|
* @return base margin
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public float[] getBaseMargin() throws XGBoostError {
|
public float[] getBaseMargin() throws XGBoostError {
|
||||||
return getFloatInfo("base_margin");
|
return getFloatInfo("base_margin");
|
||||||
@ -199,7 +199,7 @@ public class DMatrix {
|
|||||||
* Slice the DMatrix and return a new DMatrix that only contains `rowIndex`.
|
* Slice the DMatrix and return a new DMatrix that only contains `rowIndex`.
|
||||||
* @param rowIndex row index
|
* @param rowIndex row index
|
||||||
* @return sliced new DMatrix
|
* @return sliced new DMatrix
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public DMatrix slice(int[] rowIndex) throws XGBoostError {
|
public DMatrix slice(int[] rowIndex) throws XGBoostError {
|
||||||
long[] out = new long[1];
|
long[] out = new long[1];
|
||||||
@ -212,7 +212,7 @@ public class DMatrix {
|
|||||||
/**
|
/**
|
||||||
* get the row number of DMatrix
|
* get the row number of DMatrix
|
||||||
* @return number of rows
|
* @return number of rows
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public long rowNum() throws XGBoostError {
|
public long rowNum() throws XGBoostError {
|
||||||
long[] rowNum = new long[1];
|
long[] rowNum = new long[1];
|
||||||
|
|||||||
@ -21,8 +21,7 @@ import org.apache.commons.logging.LogFactory;
|
|||||||
import org.dmlc.xgboost4j.wrapper.XgboostJNI;
|
import org.dmlc.xgboost4j.wrapper.XgboostJNI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* error handle for Xgboost
|
* Error handle for Xgboost.
|
||||||
* @author hzx
|
|
||||||
*/
|
*/
|
||||||
public class ErrorHandle {
|
public class ErrorHandle {
|
||||||
private static final Log logger = LogFactory.getLog(ErrorHandle.class);
|
private static final Log logger = LogFactory.getLog(ErrorHandle.class);
|
||||||
@ -38,9 +37,9 @@ public class ErrorHandle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check the return value of C API
|
* Check the return value of C API.
|
||||||
* @param ret return valud of xgboostJNI C API call
|
* @param ret return valud of xgboostJNI C API call
|
||||||
* @throws org.dmlc.xgboost4j.util.XGBoostError Native error
|
* @throws org.dmlc.xgboost4j.util.XGBoostError native error
|
||||||
*/
|
*/
|
||||||
public static void checkCall(int ret) throws XGBoostError {
|
public static void checkCall(int ret) throws XGBoostError {
|
||||||
if(ret != 0) {
|
if(ret != 0) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user