You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
XGBoost-Node is a Node.js interface of XGBoost. XGBoost is a library from DMLC. It is designed and optimized for boosted trees. The underlying algorithm of XGBoost is an extension of the classic gbm algorithm. With multi-threads and regularization, XGBoost is able to utilize more computational power and get a more accurate prediction.
The package is made to run existing XGBoost model with Node.js easily.
Features
Runs XGBoost Model and make predictions in Node.js.
Both dense and sparse matrix input are supported, and missing value is handled.
Train a XGBoost model and save to a file, more in doc.
Load the model with XGBoost-Node:
constxgboost=require('xgboost');constmodel=xgboost.XGModel('iris.xg.model');constinput=newFloat32Array([5.1,3.5,1.4,0.2,// class 06.6,3.,4.4,1.4,// class 15.9,3.,5.1,1.8// class 2]);constmat=newxgboost.matrix(input,3,4);console.log(model.predict(mat));// {// value: [// 0.991, 0.005, 0.004, // class 0// 0.004, 0.990, 0.006, // class 1// 0.005, 0.035, 0.960, // class 2// ],// error: undefined, // no error// }consterrModel=xgboost.XGModel('data/empty');console.log(errModel);console.log(errModel.predict());
Contributing
Your help and contribution is very valuable. Welcome to submit issue and pull requests. Learn more