GithubHelp home page GithubHelp logo

leonsimba / xgboostpredictor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from seznam/xgboostpredictor

0.0 1.0 0.0 145 KB

C++ header-only thread-safe XGBoost predictor

License: Apache License 2.0

C++ 98.19% Makefile 1.81%

xgboostpredictor's Introduction

XGBoostPredictor

C++ header-only thread-safe library of XGBoost predictor without dependency on xgboost library.

Requirements

  • C++17 compiler
  • RapidJSON library installed
  • XGBoost model saved to json format (requires xgboost >= 1.0)

Using library in C++

#include "xgboostpredictor.h"
#include <iostream>

using namespace xgboost::predictor;

int main()
{
    // load xgboost json model
    XGBoostPredictor predictor("model.json");

    // prepare features (3 features total)
    XGBoostPredictor::Data data(3);

    // set features
    // NOTE: feature 0 is set to 1.2, feature 1 is missing and feature 2 is set to 3.4
    data[0] = 1.2f;
    data[2] = 3.4f;
    
    // make prediction
    const auto prediction = predictor.predict(data);

    // print predicted value
    std::cout << prediction[0] << std::endl;
}

xgboostpredictor's People

Contributors

jaroslavgratz avatar

Watchers

 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.