public class CatBoostModel extends Object implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
static class |
CatBoostModel.CatFeature |
static class |
CatBoostModel.Feature |
static class |
CatBoostModel.FloatFeature |
static class |
CatBoostModel.TextFeature |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected void |
finalize() |
String[] |
getFeatureNames() |
List<CatBoostModel.Feature> |
getFeatures() |
Map<String,String> |
getMetadata() |
int |
getPredictionDimension() |
int |
getTreeCount() |
int |
getUsedCategoricFeatureCount() |
int |
getUsedNumericFeatureCount() |
static CatBoostModel |
loadModel(InputStream in)
Load CatBoost model from stream.
|
static CatBoostModel |
loadModel(String modelPath)
Load CatBoost model from file modelPath.
|
CatBoostPredictions |
predict(float[][] numericFeatures,
int[][] catFeatureHashes)
Same as
predict(float[][], String[][], CatBoostPredictions), but returns predictions instead of taking
it as third parameter. |
void |
predict(float[][] numericFeatures,
int[][] catFeatureHashes,
CatBoostPredictions prediction)
Same as
predict(float[][], String[][], CatBoostPredictions), but accept categoric features as hashes
computed by hashCategoricalFeature(String). |
CatBoostPredictions |
predict(float[][] numericFeatures,
String[][] catFeatures)
Same as
predict(float[][], String[][], CatBoostPredictions), but returns prediction instead of taking
it as third parameter. |
void |
predict(float[][] numericFeatures,
String[][] catFeatures,
CatBoostPredictions prediction)
Apply model to a batch of objects.
|
CatBoostPredictions |
predict(float[] numericFeatures,
int[] catFeatureHashes)
Same as
predict(float[], int[], CatBoostPredictions), but returns prediction instead of taking it as
third parameter. |
void |
predict(float[] numericFeatures,
int[] catFeatureHashes,
CatBoostPredictions prediction)
Same as
predict(float[], String[], CatBoostPredictions), but accept categoric features as hashes
computed by hashCategoricalFeature(String). |
CatBoostPredictions |
predict(float[] numericFeatures,
String[] catFeatures)
Same as
predict(float[], String[], CatBoostPredictions), but returns prediction instead of taking it
as third parameter. |
void |
predict(float[] numericFeatures,
String[] catFeatures,
CatBoostPredictions prediction)
Apply model to object defined by features.
|
@NotNull public static CatBoostModel loadModel(@NotNull String modelPath) throws ai.catboost.CatBoostError
modelPath - Path to the model.CatBoostError - When failed to load model.@NotNull public static CatBoostModel loadModel(InputStream in) throws ai.catboost.CatBoostError, IOException
in - Input stream containing model.CatBoostError - When failed to load model.IOException - When failed to read model from file.public int getPredictionDimension()
public int getTreeCount()
public int getUsedNumericFeatureCount()
public int getUsedCategoricFeatureCount()
public String[] getFeatureNames()
public List<CatBoostModel.Feature> getFeatures()
public void predict(@Nullable float[] numericFeatures, @Nullable String[] catFeatures, @NotNull CatBoostPredictions prediction) throws ai.catboost.CatBoostError
numericFeatures - Numeric features.catFeatures - Categoric features.prediction - Model predictions.CatBoostError - In case of error within native library.@NotNull public CatBoostPredictions predict(@Nullable float[] numericFeatures, @Nullable String[] catFeatures) throws ai.catboost.CatBoostError
predict(float[], String[], CatBoostPredictions), but returns prediction instead of taking it
as third parameter.numericFeatures - Numeric features.catFeatures - Categoric features.CatBoostError - In case of error within native library.public void predict(@Nullable float[] numericFeatures, @Nullable int[] catFeatureHashes, @NotNull CatBoostPredictions prediction) throws ai.catboost.CatBoostError
predict(float[], String[], CatBoostPredictions), but accept categoric features as hashes
computed by hashCategoricalFeature(String).numericFeatures - Numeric features.catFeatureHashes - Categoric feature hashes.prediction - Model predictions.CatBoostError - In case of error within native library.@NotNull public CatBoostPredictions predict(@Nullable float[] numericFeatures, @Nullable int[] catFeatureHashes) throws ai.catboost.CatBoostError
predict(float[], int[], CatBoostPredictions), but returns prediction instead of taking it as
third parameter.numericFeatures - Numeric features.catFeatureHashes - Categoric feature hashes.CatBoostError - In case of error within native library.public void predict(@Nullable float[][] numericFeatures, @Nullable String[][] catFeatures, @NotNull CatBoostPredictions prediction) throws ai.catboost.CatBoostError
numericFeatures - Numeric features matrix.catFeatures - Categoric features matrix.prediction - Model predictions.CatBoostError - In case of error within native library.@NotNull public CatBoostPredictions predict(@Nullable float[][] numericFeatures, @Nullable String[][] catFeatures) throws ai.catboost.CatBoostError
predict(float[][], String[][], CatBoostPredictions), but returns prediction instead of taking
it as third parameter.numericFeatures - Numeric features.catFeatures - Categoric features.CatBoostError - In case of error within native library.public void predict(@Nullable float[][] numericFeatures, @Nullable int[][] catFeatureHashes, @NotNull CatBoostPredictions prediction) throws ai.catboost.CatBoostError
predict(float[][], String[][], CatBoostPredictions), but accept categoric features as hashes
computed by hashCategoricalFeature(String).numericFeatures - Numeric features.catFeatureHashes - Categoric feature hashes.prediction - Model predictions.CatBoostError - In case of error within native library.@NotNull public CatBoostPredictions predict(@Nullable float[][] numericFeatures, @Nullable int[][] catFeatureHashes) throws ai.catboost.CatBoostError
predict(float[][], String[][], CatBoostPredictions), but returns predictions instead of taking
it as third parameter.numericFeatures - Numeric features.catFeatureHashes - Categoric feature hashes.CatBoostError - In case of error within native library.protected void finalize()
throws Throwable
public void close()
throws ai.catboost.CatBoostError
close in interface AutoCloseableai.catboost.CatBoostErrorCopyright © 2020 CatBoost dev team. All rights reserved.