Giter Site home page Giter Site logo

prvnsmpth / xgboost-node Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nuanio/xgboost-node

1.0 0.0 0.0 6.17 MB

Run XGBoost model and make predictions in Node.js

License: Other

Python 3.59% Shell 2.27% JavaScript 36.58% TypeScript 22.32% C++ 35.23%

xgboost-node's Introduction

XGBoost-Node

Build Status NPM version codecov license

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.

Features

  • 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

Install from npm

npm install xgboost

Install from GitHub

git clone --recursive [email protected]:nuanio/xgboost-node.git
npm install

Documentation

Roadmap

  • Matrix API
  • Model API
  • Prediction API
  • Async API
  • Windows Support
  • Training API
  • Visualization API

Examples

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());

Contributing

Your help and contribution is very valuable. Welcome to submit issue and pull requests. Learn more

xgboost-node's People

Contributors

prvnsmpth avatar qinwf-nuan avatar jiabinf avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.