Apply in Java

Quick start
To apply a previously trained CatBoost model in Java:
  1. Install the package using a package manager.

    For example, change the source_version line to the latest available version and add the following block to the dependencies section of the pom.xml file for Maven:
    <!-- --> 
  2. Load the trained model:

    import ai.catboost.CatBoostModel;
    import ai.catboost.CatBoostPredictions;
    CatBoostModel model = new CatBoostModel.loadModel("model.cbm");
  3. Apply the model:
    CatBoostPredictions prediction = model.predict(new float[3]{0.1f, 0.3f, 0.2f}, new String[3]{"foo", "bar", "baz"});
    // assuming that this is a regression task
    System.out.print("model value is " + String.valueOf(prediction.get(0, 0));
Provided classes
Class Description

Basic model application methods.


A wrapper that provides methods for making convenient predictions for certain classes.