Module uses CatBoost C/C++ library (catboostmodel.dll/libcatboostmodel.so).
For install CatBoost wrapper for Node.js use NPM:
npm install catboost
Single object:
const catboost = require('catboost')
const model = new catboost.Model('flats.bin')
const price = model.calc([
'Moscow', // city
2, // rooms
50, // square
9, // floor
12 // total floors
])
console.log(`Flat price: ${price.toFixed()} RUR`)
Many objects:
const catboost = require('catboost')
const model = new catboost.Model('flats.bin')
const prices = model.calcMany([
[
'Moscow', // city
2, // rooms
50, // square
9, // floor
12 // total floors
],
[
'Yekaterinburg', // city
1, // rooms
35, // square
2, // floor
9 // total floors
]
])
console.log(`Flat prices: ${price[0].toFixed()} RUR and ${price[1].toFixed()} RUR`)