
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
eXtreme Gradient Boosting Package in Node.js
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.
Runs XGBoost Model and make predictions in Node.js.
Both dense and sparse matrix input are supported, and missing value is handled.
Supports Linux, macOS.
Install from npm
npm install xgboost
Install from GitHub
git clone --recursive git@github.com:nuanio/xgboost-node.git
npm install
Train a XGBoost model and save to a file, more in doc.
Load the model with XGBoost-Node:
const xgboost = require('xgboost');
const model = xgboost.XGModel('iris.xg.model');
const input = new Float32Array([
5.1, 3.5, 1.4, 0.2, // class 0
6.6, 3. , 4.4, 1.4, // class 1
5.9, 3. , 5.1, 1.8 // class 2
]);
const mat = new xgboost.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
// }
const errModel = xgboost.XGModel('data/empty');
console.log(errModel);
console.log(errModel.predict());
Your help and contribution is very valuable. Welcome to submit issue and pull requests. Learn more
FAQs
XGBoost in Node.js
The npm package xgboost receives a total of 90 weekly downloads. As such, xgboost popularity was classified as not popular.
We found that xgboost demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.