loadModel

The CatBoost Java package provides different methods for loading CatBoost models.

  1. Load the model from a stream
  2. Load the model from a file

Load the model from a stream

public static CatBoostModel loadModel(java.io.InputStream in)
Purpose

Load the CatBoost model from a stream.

Parameters
Parameter Description
in The input stream with the CatBoost model.
Returns

CatBoost model.

Throws
  • CatBoostError — When the attempt to load the model fails.

  • java.io.IOException — When the attempt to read the model fails.

Load the model from a file

public static CatBoostModel loadModel(String modelPath)
Purpose

Load the CatBoost model from a file.

Parameters
Parameter Description
modelPath The path to the input CatBoost model.
Returns

CatBoost model.

Throws
  • CatBoostError — When the attempt to load the model fails.

  • java.io.IOException — When the attempt to read the model fails.