CatBoost Model Node package

A Node.js package for applying pretrained CatBoost models.


Install the package. You have two options:

  • Install from npm registry:

    npm i catboost
  • Build package from source.

    CatBoost source code is stored as a Git repository on GitHub at You can obtain a local copy of this Git repository by running the following command from a command line interpreter (you need to have Git command line tools installed):

    git clone

    Navigate to $PATH_TO_CATBOOST_REPO/catboost/node-package directory inside the repo and run:

    npm install

    Now you can link this package in your project via:

    npm install $PATH_TO_CATBOOST_REPO/catboost/node-package


Apply the pretrained model.

Example with numerical and categorical features (they must be passed in separate arrays containing features of
each type for all samples):

catboost = require('catboost');

model = new catboost.Model();

prediction = model.predict([
            [40., 85019., 16., 0., 0., 45.],
            [28., 85019., 13., 0., 0., 13.],
            ["Private", "Doctorate", "Married-civ-spouce", "Prof-specialty", "Husband", "Asian-Pac-Islander", "Male", "nan"],
            ["Self-emp-not-inc", "Bachelors", "Married-civ-spouce", "Exec-managerial", "Husband", "White", "Male", "United-States"],
In this article: