Modifier and Type | Method and Description |
---|---|
void |
Booster.boost(DMatrix dtrain,
float[] grad,
float[] hess)
update with give grad and hess
|
static String[] |
XGBoost.crossValidation(DMatrix data,
Map<String,Object> params,
int round,
int nfold,
String[] metrics,
IObjective obj,
IEvaluation eval)
Cross-validation with given parameters.
|
String |
Booster.evalSet(DMatrix[] evalMatrixs,
String[] evalNames,
IEvaluation eval)
evaluate with given customized Evaluation class
|
String |
Booster.evalSet(DMatrix[] evalMatrixs,
String[] evalNames,
IEvaluation eval,
float[] metricsOut) |
String |
Booster.evalSet(DMatrix[] evalMatrixs,
String[] evalNames,
int iter)
evaluate with given dmatrixs.
|
String |
Booster.evalSet(DMatrix[] evalMatrixs,
String[] evalNames,
int iter,
float[] metricsOut)
evaluate with given dmatrixs.
|
float[] |
DMatrix.getBaseMargin()
Get base margin of the DMatrix.
|
Map<String,Integer> |
Booster.getFeatureScore(String featureMap)
Get importance of each feature
|
Map<String,Integer> |
Booster.getFeatureScore(String[] featureNames)
Get importance of each feature with specified feature names.
|
float[] |
DMatrix.getLabel()
get label values
|
String[] |
Booster.getModelDump(String[] featureNames,
boolean withStats)
Get the dump of the model as a string array with specified feature names.
|
String[] |
Booster.getModelDump(String[] featureNames,
boolean withStats,
String format) |
String[] |
Booster.getModelDump(String featureMap,
boolean withStats)
Get the dump of the model as a string array
|
String[] |
Booster.getModelDump(String featureMap,
boolean withStats,
String format) |
static int |
Rabit.getRank()
get rank of current thread.
|
Map<String,Double> |
Booster.getScore(String[] featureNames,
String importanceType)
Get the feature importances for gain or cover (average or total)
|
Map<String,Double> |
Booster.getScore(String featureMap,
String importanceType)
Get the feature importances for gain or cover (average or total), with feature names
|
float[] |
DMatrix.getWeight()
get weight of the DMatrix
|
static int |
Rabit.getWorldSize()
get world size of current job.
|
static void |
Rabit.init(Map<String,String> envs)
Initialize the rabit library on current working thread.
|
static Booster |
XGBoost.loadModel(InputStream in)
Load a new Booster model from a file opened as input stream.
|
static Booster |
XGBoost.loadModel(String modelPath)
load model from modelPath
|
float[][] |
Booster.predict(DMatrix data)
Predict with data
|
float[][] |
Booster.predict(DMatrix data,
boolean outputMargin)
Predict with data
|
float[][] |
Booster.predict(DMatrix data,
boolean outputMargin,
int treeLimit)
Advanced predict function with all the options.
|
float[][] |
Booster.predictContrib(DMatrix data,
int treeLimit)
Output feature contributions toward predictions of given data
|
float[][] |
Booster.predictLeaf(DMatrix data,
int treeLimit)
Predict leaf indices given the data
|
long |
DMatrix.rowNum()
get the row number of DMatrix
|
void |
Booster.saveModel(OutputStream out)
Save the model to file opened as output stream.
|
void |
Booster.saveModel(String modelPath)
Save model to modelPath
|
void |
DMatrix.setBaseMargin(float[] baseMargin)
Set base margin (initial prediction).
|
void |
DMatrix.setBaseMargin(float[][] baseMargin)
Set base margin (initial prediction).
|
void |
DMatrix.setGroup(int[] group)
Set group sizes of DMatrix (used for ranking)
|
void |
DMatrix.setLabel(float[] labels)
set label of dmatrix
|
void |
Booster.setParam(String key,
Object value)
Set parameter to the Booster.
|
void |
Booster.setParams(Map<String,Object> params)
Set parameters to the Booster.
|
void |
DMatrix.setWeight(float[] weights)
set weight of each instance
|
static void |
Rabit.shutdown()
Shutdown the rabit engine in current working thread, equals to finalize.
|
DMatrix |
DMatrix.slice(int[] rowIndex)
Slice the DMatrix and return a new DMatrix that only contains `rowIndex`.
|
byte[] |
Booster.toByteArray() |
static void |
Rabit.trackerPrint(String msg)
Print the message on rabit tracker.
|
static Booster |
XGBoost.train(DMatrix dtrain,
Map<String,Object> params,
int round,
Map<String,DMatrix> watches,
float[][] metrics,
IObjective obj,
IEvaluation eval,
int earlyStoppingRound)
Train a booster given parameters.
|
static Booster |
XGBoost.train(DMatrix dtrain,
Map<String,Object> params,
int round,
Map<String,DMatrix> watches,
float[][] metrics,
IObjective obj,
IEvaluation eval,
int earlyStoppingRounds,
Booster booster)
Train a booster given parameters.
|
static Booster |
XGBoost.train(DMatrix dtrain,
Map<String,Object> params,
int round,
Map<String,DMatrix> watches,
IObjective obj,
IEvaluation eval)
Train a booster given parameters.
|
void |
Booster.update(DMatrix dtrain,
int iter)
Update the booster for one iteration.
|
void |
Booster.update(DMatrix dtrain,
IObjective obj)
Update with customize obj func
|
static int |
Rabit.versionNumber()
Get version number of current stored model in the thread.
|
Constructor and Description |
---|
DMatrix(float[] data,
int nrow,
int ncol)
create DMatrix from dense matrix
|
DMatrix(float[] data,
int nrow,
int ncol,
float missing)
create DMatrix from dense matrix
|
DMatrix(Iterator<LabeledPoint> iter,
String cacheInfo)
Create DMatrix from iterator.
|
DMatrix(long[] headers,
int[] indices,
float[] data,
DMatrix.SparseType st)
Deprecated.
|
DMatrix(long[] headers,
int[] indices,
float[] data,
DMatrix.SparseType st,
int shapeParam)
Create DMatrix from Sparse matrix in CSR/CSC format.
|
DMatrix(String dataPath)
Create DMatrix by loading libsvm file from dataPath
|
RabitTracker(int numWorkers) |
Copyright © 2019. All rights reserved.