public class CatBoostModel extends Object implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
static class |
CatBoostModel.CatFeature |
static class |
CatBoostModel.EmbeddingFeature |
static class |
CatBoostModel.Feature |
static class |
CatBoostModel.FloatFeature |
static class |
CatBoostModel.FormulaEvaluatorType |
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 |
getUsedEmbeddingFeatureCount() |
int |
getUsedNumericFeatureCount() |
int |
getUsedTextFeatureCount() |
static CatBoostModel |
loadModel(InputStream in)
Load CatBoost model from stream.
|
static CatBoostModel |
loadModel(InputStream in,
String modelFormat)
Load CatBoost model from stream.
|
static CatBoostModel |
loadModel(String modelPath)
Load CatBoost model from file modelPath.
|
static CatBoostModel |
loadModel(String modelPath,
String modelFormat)
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 the last 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,
int[][] catFeatureHashes,
String[][] textFeatures,
float[][][] embeddingFeatures)
Same as
predict(float[][], String[][], String[][], float[][][], CatBoostPredictions), but returns predictions instead of taking
it as the last parameter. |
void |
predict(float[][] numericFeatures,
int[][] catFeatureHashes,
String[][] textFeatures,
float[][][] embeddingFeatures,
CatBoostPredictions prediction)
Same as
predict(float[][], String[][], String[][], float[][][], 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 the last parameter. |
void |
predict(float[][] numericFeatures,
String[][] catFeatures,
CatBoostPredictions prediction)
Apply model to a batch of objects.
|
CatBoostPredictions |
predict(float[][] numericFeatures,
String[][] catFeatures,
String[][] textFeatures,
float[][][] embeddingFeatures)
Same as
predict(float[][], String[][], String[][], float[][][], CatBoostPredictions), but returns prediction instead of taking
it as the last parameter. |
void |
predict(float[][] numericFeatures,
String[][] catFeatures,
String[][] textFeatures,
float[][][] embeddingFeatures,
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,
int[] catFeatureHashes,
String[] textFeatures,
float[][] embeddingFeatures)
Same as
predict(float[], int[], String[], float[][], CatBoostPredictions), but returns prediction instead of taking it as
third parameter. |
void |
predict(float[] numericFeatures,
int[] catFeatureHashes,
String[] textFeatures,
float[][] embeddingFeatures,
CatBoostPredictions prediction)
Same as
predict(float[], String[], String[], float[][], 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 the last parameter. |
void |
predict(float[] numericFeatures,
String[] catFeatures,
CatBoostPredictions prediction)
Apply model to object defined by features.
|
CatBoostPredictions |
predict(float[] numericFeatures,
String[] catFeatures,
String[] textFeatures,
float[][] embeddingFeatures)
Same as
predict(float[], String[], String[], float[][], CatBoostPredictions), but returns prediction instead of taking it
as the last parameter. |
void |
predict(float[] numericFeatures,
String[] catFeatures,
String[] textFeatures,
float[][] embeddingFeatures,
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(@NotNull String modelPath, @NotNull String modelFormat) throws ai.catboost.CatBoostError
modelPath - Path to the model.modelFormat - Model file format (bin or json)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.@NotNull public static CatBoostModel loadModel(InputStream in, @NotNull String modelFormat) throws ai.catboost.CatBoostError, IOException
in - Input stream containing model.modelFormat - Model file format (bin or json)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 int getUsedTextFeatureCount()
public int getUsedEmbeddingFeatureCount()
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.public void predict(@Nullable float[] numericFeatures, @Nullable String[] catFeatures, @Nullable String[] textFeatures, @Nullable float[][] embeddingFeatures, @NotNull CatBoostPredictions prediction) throws ai.catboost.CatBoostError
numericFeatures - Numeric features.catFeatures - Categoric features.textFeatures - Text features.embeddingFeatures - Embedding 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 the last parameter.numericFeatures - Numeric features.catFeatures - Categoric features.CatBoostError - In case of error within native library.@NotNull public CatBoostPredictions predict(@Nullable float[] numericFeatures, @Nullable String[] catFeatures, @Nullable String[] textFeatures, @Nullable float[][] embeddingFeatures) throws ai.catboost.CatBoostError
predict(float[], String[], String[], float[][], CatBoostPredictions), but returns prediction instead of taking it
as the last parameter.numericFeatures - Numeric features.catFeatures - Categoric features.textFeatures - Text features.embeddingFeatures - Embedding 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.public void predict(@Nullable float[] numericFeatures, @Nullable int[] catFeatureHashes, @Nullable String[] textFeatures, @Nullable float[][] embeddingFeatures, @NotNull CatBoostPredictions prediction) throws ai.catboost.CatBoostError
predict(float[], String[], String[], float[][], CatBoostPredictions), but accept categoric features as hashes
computed by hashCategoricalFeature(String).numericFeatures - Numeric features.catFeatureHashes - Categoric feature hashes.textFeatures - Text features.embeddingFeatures - Embedding features.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.@NotNull public CatBoostPredictions predict(@Nullable float[] numericFeatures, @Nullable int[] catFeatureHashes, @Nullable String[] textFeatures, @Nullable float[][] embeddingFeatures) throws ai.catboost.CatBoostError
predict(float[], int[], String[], float[][], CatBoostPredictions), but returns prediction instead of taking it as
third parameter.numericFeatures - Numeric features.catFeatureHashes - Categoric feature hashes.textFeatures - Text features.embeddingFeatures - Embedding features.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.public void predict(@Nullable float[][] numericFeatures, @Nullable String[][] catFeatures, @Nullable String[][] textFeatures, @Nullable float[][][] embeddingFeatures, @NotNull CatBoostPredictions prediction) throws ai.catboost.CatBoostError
numericFeatures - Numeric features matrix.catFeatures - Categoric features matrix.textFeatures - Text features matrix.embeddingFeatures - Embedding 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 the last parameter.numericFeatures - Numeric features.catFeatures - Categoric features.CatBoostError - In case of error within native library.@NotNull public CatBoostPredictions predict(@Nullable float[][] numericFeatures, @Nullable String[][] catFeatures, @Nullable String[][] textFeatures, @Nullable float[][][] embeddingFeatures) throws ai.catboost.CatBoostError
predict(float[][], String[][], String[][], float[][][], CatBoostPredictions), but returns prediction instead of taking
it as the last parameter.numericFeatures - Numeric features.catFeatures - Categoric features.textFeatures - Text features.embeddingFeatures - Embedding 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.public void predict(@Nullable float[][] numericFeatures, @Nullable int[][] catFeatureHashes, @Nullable String[][] textFeatures, @Nullable float[][][] embeddingFeatures, @NotNull CatBoostPredictions prediction) throws ai.catboost.CatBoostError
predict(float[][], String[][], String[][], float[][][], CatBoostPredictions), but accept categoric features as hashes
computed by hashCategoricalFeature(String).numericFeatures - Numeric features.catFeatureHashes - Categoric feature hashes.textFeatures - Text features.embeddingFeatures - Embedding features.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 the last parameter.numericFeatures - Numeric features.catFeatureHashes - Categoric feature hashes.CatBoostError - In case of error within native library.@NotNull public CatBoostPredictions predict(@Nullable float[][] numericFeatures, @Nullable int[][] catFeatureHashes, @Nullable String[][] textFeatures, @Nullable float[][][] embeddingFeatures) throws ai.catboost.CatBoostError
predict(float[][], String[][], String[][], float[][][], CatBoostPredictions), but returns predictions instead of taking
it as the last parameter.numericFeatures - Numeric features.catFeatureHashes - Categoric feature hashes.textFeatures - Text features.embeddingFeatures - Embedding features.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 © 2023 CatBoost dev team. All rights reserved.