| Package | Description |
|---|---|
| ml.dmlc.xgboost4j.java |
| Modifier and Type | Method and Description |
|---|---|
void |
Booster.boost(DMatrix dtrain,
float[] grad,
float[] hess)
Deprecated.
|
void |
Booster.boost(DMatrix dtrain,
int iter,
float[] grad,
float[] hess)
Update with give grad and hess
|
void |
ConfigContext.close() |
static void |
Communicator.communicatorPrint(String msg)
Print the message via the communicator.
|
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 the Booster model 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 the Booster model with given dmatrixs.
|
String |
Booster.evalSet(DMatrix[] evalMatrixs,
String[] evalNames,
int iter,
float[] metricsOut)
Evaluate the Booster model with given dmatrixs.
|
String |
Booster.getAttr(String key)
Get attribute value from the Booster based on the key provided.
|
Map<String,String> |
Booster.getAttrs()
Get attributes stored in the Booster as a Map.
|
float[] |
DMatrix.getBaseMargin()
Get base margin of the DMatrix.
|
Object |
ConfigContext.getConfig(String name) |
String[] |
Booster.getFeatureNames()
Get all the feature names from the Booster.
|
String[] |
DMatrix.getFeatureNames()
Get feature names
|
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.
|
String[] |
Booster.getFeatureTypes()
Get feature types from the Booster.
|
String[] |
DMatrix.getFeatureTypes()
Get feature types
|
int[] |
DMatrix.getGroup()
Get group sizes of DMatrix
|
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)
Get the dump of the model as a string array with specified feature map, stats,
and the specified 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)
Get the dump of the model as a string array with specified feature map, stats,
and the specified format.
|
int |
Booster.getNumBoostedRound() |
long |
Booster.getNumFeature()
Get number of model features.
|
DMatrix.QuantileCut |
DMatrix.getQuantileCut()
Get the Quantile Cut.
|
static int |
Communicator.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
|
Map<String,Object> |
RabitTracker.getWorkerArgs()
Get environments that can be used to pass to worker.
|
Map<String,Object> |
ITracker.getWorkerArgs() |
static int |
Communicator.getWorldSize()
get world size of current job.
|
static void |
Communicator.init(Map<String,Object> envs)
Initialize the collective communicator on current working thread.
|
float[][] |
Booster.inplace_predict(float[] data,
int nrow,
int ncol,
float missing)
Perform thread-safe prediction.
|
float[][] |
Booster.inplace_predict(float[] data,
int nrow,
int ncol,
float missing,
int[] iteration_range)
Perform thread-safe prediction.
|
float[][] |
Booster.inplace_predict(float[] data,
int nrow,
int ncol,
float missing,
int[] iteration_range,
Booster.PredictionType predict_type,
float[] base_margin)
Perform thread-safe prediction.
|
Booster |
ExternalCheckpointManager.loadCheckpointAsBooster()
Read the checkpoint from the checkpoint path.
|
static Booster |
XGBoost.loadModel(byte[] buffer)
Load a new Booster model from a byte array buffer.
|
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
|
long |
DMatrix.nonMissingNum()
Get the number of non-missing values of DMatrix.
|
float[][] |
Booster.predict(DMatrix data)
Make a prediction with test data in a DMatrix format.
|
float[][] |
Booster.predict(DMatrix data,
boolean outputMargin)
Make a prediction with test data in a DMatrix format and output margin.
|
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(OutputStream out,
String format)
Save the model to file opened as output stream.
|
void |
Booster.saveModel(String modelPath)
Save model to modelPath
|
void |
Booster.setAttr(String key,
String value)
Set an attribute key-value pair to the Booster.
|
void |
Booster.setAttrs(Map<String,String> attrs)
Set multiple attribute key-value pairs to the Booster.
|
void |
DMatrix.setBaseMargin(Column column)
Set base margin of DMatrix from array interface
|
void |
DMatrix.setBaseMargin(float[] baseMargin)
Set base margin (initial prediction).
|
void |
DMatrix.setBaseMargin(float[][] baseMargin)
Set base margin (initial prediction).
|
void |
ConfigContext.setConfig(String key,
Object value)
Set one single configuration
|
void |
ConfigContext.setConfigs(Map<String,Object> configs)
Set a bunch of configurations
|
void |
Booster.setFeatureNames(String[] featureNames)
Set feature names to the Booster.
|
void |
DMatrix.setFeatureNames(String[] values)
Set feature names
|
void |
Booster.setFeatureTypes(String[] featureTypes)
Set feature types to the Booster.
|
void |
DMatrix.setFeatureTypes(String[] values)
Set feature types
|
void |
DMatrix.setGroup(int[] group)
Set group sizes of DMatrix (used for ranking)
|
void |
DMatrix.setLabel(Column column)
Set label of DMatrix from array interface
|
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.setQueryId(Column column)
Set query id of DMatrix from array interface
|
void |
DMatrix.setQueryId(int[] qid)
Set query ids (used for ranking)
|
void |
DMatrix.setWeight(Column column)
Set weight of DMatrix from array interface
|
void |
DMatrix.setWeight(float[] weights)
set weight of each instance
|
static void |
Communicator.shutdown()
Shutdown the communicator in current working thread, equals to finalize.
|
DMatrix |
DMatrix.slice(int[] rowIndex)
Slice the DMatrix and return a new DMatrix that only contains `rowIndex`.
|
boolean |
RabitTracker.start() |
boolean |
ITracker.start() |
void |
RabitTracker.stop() |
void |
ITracker.stop() |
byte[] |
Booster.toByteArray()
Save model into raw byte array in the UBJSON ("ubj") format.
|
byte[] |
Booster.toByteArray(String format)
Save model into raw byte array.
|
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.
|
static Booster |
XGBoost.trainAndSaveCheckpoint(DMatrix dtrain,
Map<String,Object> params,
int numRounds,
Map<String,DMatrix> watches,
float[][] metrics,
IObjective obj,
IEvaluation eval,
int earlyStoppingRounds,
Booster booster,
int checkpointInterval,
String checkpointPath,
org.apache.hadoop.fs.FileSystem fs) |
void |
Booster.update(DMatrix dtrain,
int iter)
Update the booster for one iteration.
|
void |
Booster.update(DMatrix dtrain,
int iter,
IObjective obj)
Update with customize object functon
|
void |
Booster.update(DMatrix dtrain,
IObjective obj)
Deprecated.
|
void |
ExternalCheckpointManager.updateCheckpoint(Booster boosterToCheckpoint)
This method updates the booster checkpoint to the the latest or current
version and deleted all the previous versions of the checkpoint.
|
void |
RabitTracker.waitFor(long timeout) |
void |
ITracker.waitFor(long taskExecutionTimeout) |
| Constructor and Description |
|---|
ConfigContext() |
ConfigContext(Map<String,Object> params) |
DMatrix(BigDenseMatrix matrix)
create DMatrix from a BigDenseMatrix
|
DMatrix(BigDenseMatrix matrix,
float missing)
create DMatrix from dense matrix
|
DMatrix(ColumnBatch columnBatch,
float missing,
int nthread)
Create the normal DMatrix from column array interface
|
DMatrix(float[] data,
int nrow,
int ncol)
Deprecated.
Please specify the missing value explicitly using
DMatrix(float[], int, int, float) |
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(Iterator<LabeledPoint> iter,
String cacheInfo,
float missing)
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(long[] headers,
int[] indices,
float[] data,
DMatrix.SparseType st,
int shapeParam,
float missing,
int nthread) |
DMatrix(String dataPath)
Create DMatrix by loading libsvm file from dataPath
|
ExternalCheckpointManager(String checkpointPath,
org.apache.hadoop.fs.FileSystem fs)
This constructor creates a new Expternal Checkpoint Manager at the specified path in the
specified file system.
|
RabitTracker(int numWorkers) |
RabitTracker(int numWorkers,
String hostIp) |
RabitTracker(int numWorkers,
String hostIp,
int port,
int timeout) |
Copyright © 2026. All rights reserved.