All Projects → davechallis → rust-xgboost

davechallis / rust-xgboost

Licence: MIT license
Rust bindings for XGBoost.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to rust-xgboost

sqlite3
The fastest and correct module for SQLite3 in Deno.
Stars: ✭ 143 (+85.71%)
Mutual labels:  ffi
neptune-client
📒 Experiment tracking tool and model registry
Stars: ✭ 348 (+351.95%)
Mutual labels:  xgboost
MSDS696-Masters-Final-Project
Earthquake Prediction Challenge with LightGBM and XGBoost
Stars: ✭ 58 (-24.68%)
Mutual labels:  xgboost
stackgbm
🌳 Stacked Gradient Boosting Machines
Stars: ✭ 24 (-68.83%)
Mutual labels:  xgboost
rdp
A library providing FFI access to fast Ramer–Douglas–Peucker and Visvalingam-Whyatt line simplification algorithms
Stars: ✭ 20 (-74.03%)
Mutual labels:  ffi
r6rs-pffi
Portable Foreign Function Interface (FFI) for R6RS
Stars: ✭ 40 (-48.05%)
Mutual labels:  ffi
sagemaker-xgboost-container
This is the Docker container based on open source framework XGBoost (https://xgboost.readthedocs.io/en/latest/) to allow customers use their own XGBoost scripts in SageMaker.
Stars: ✭ 93 (+20.78%)
Mutual labels:  xgboost
php-ffi-rust
PHP7.4 + Rust
Stars: ✭ 28 (-63.64%)
Mutual labels:  ffi
MannvilleGroup Strat Hackathon
stratigraphic machine-learning - active work moved to Predictatops
Stars: ✭ 17 (-77.92%)
Mutual labels:  xgboost
ffi-sdl
PHP FFI SDL bindings
Stars: ✭ 23 (-70.13%)
Mutual labels:  ffi
crfsuite-rs
Rust binding to crfsuite
Stars: ✭ 19 (-75.32%)
Mutual labels:  ffi
dmatrix2np
Convert XGBoost's DMatrix format to np.array
Stars: ✭ 14 (-81.82%)
Mutual labels:  xgboost
JitFFI
A fast and customizable JIT compiler for FFI (Foreign-Function Interface).
Stars: ✭ 45 (-41.56%)
Mutual labels:  ffi
Machine-Learning-Models
In This repository I made some simple to complex methods in machine learning. Here I try to build template style code.
Stars: ✭ 30 (-61.04%)
Mutual labels:  xgboost
Kaggle
Kaggle Kernels (Python, R, Jupyter Notebooks)
Stars: ✭ 26 (-66.23%)
Mutual labels:  xgboost
yajl-ffi
Ruby FFI bindings to the native YAJL streaming JSON parser.
Stars: ✭ 15 (-80.52%)
Mutual labels:  ffi
Github-Stars-Predictor
It's a github repo star predictor that tries to predict the stars of any github repository having greater than 100 stars.
Stars: ✭ 34 (-55.84%)
Mutual labels:  xgboost
AutoTabular
Automatic machine learning for tabular data. ⚡🔥⚡
Stars: ✭ 51 (-33.77%)
Mutual labels:  xgboost
rid-examples
Examples showing how to use Rid in order to build Dart/Flutter apps integrated with Rust.
Stars: ✭ 191 (+148.05%)
Mutual labels:  ffi
rust lisp
A Rust-embeddable Lisp, with support for interop with native Rust functions
Stars: ✭ 128 (+66.23%)
Mutual labels:  ffi

rust-xgboost

Travis Build Status Documentation link

Rust bindings for the XGBoost gradient boosting library.

Basic usage example:

extern crate xgboost;

use xgboost::{parameters, DMatrix, Booster};

fn main() {
    // training matrix with 5 training examples and 3 features
    let x_train = &[1.0, 1.0, 1.0,
                    1.0, 1.0, 0.0,
                    1.0, 1.0, 1.0,
                    0.0, 0.0, 0.0,
                    1.0, 1.0, 1.0];
    let num_rows = 5;
    let y_train = &[1.0, 1.0, 1.0, 0.0, 1.0];

    // convert training data into XGBoost's matrix format
    let mut dtrain = DMatrix::from_dense(x_train, num_rows).unwrap();

    // set ground truth labels for the training matrix
    dtrain.set_labels(y_train).unwrap();

    // test matrix with 1 row
    let x_test = &[0.7, 0.9, 0.6];
    let num_rows = 1;
    let y_test = &[1.0];
    let mut dtest = DMatrix::from_dense(x_test, num_rows).unwrap();
    dtest.set_labels(y_test).unwrap();

    // configure objectives, metrics, etc.
    let learning_params = parameters::learning::LearningTaskParametersBuilder::default()
        .objective(parameters::learning::Objective::BinaryLogistic)
        .build().unwrap();

    // configure the tree-based learning model's parameters
    let tree_params = parameters::tree::TreeBoosterParametersBuilder::default()
            .max_depth(2)
            .eta(1.0)
            .build().unwrap();

    // overall configuration for Booster
    let booster_params = parameters::BoosterParametersBuilder::default()
        .booster_type(parameters::BoosterType::Tree(tree_params))
        .learning_params(learning_params)
        .verbose(true)
        .build().unwrap();

    // specify datasets to evaluate against during training
    let evaluation_sets = &[(&dtrain, "train"), (&dtest, "test")];

    // overall configuration for training/evaluation
    let params = parameters::TrainingParametersBuilder::default()
        .dtrain(&dtrain)                         // dataset to train with
        .boost_rounds(2)                         // number of training iterations
        .booster_params(booster_params)          // model parameters
        .evaluation_sets(Some(evaluation_sets)) // optional datasets to evaluate against in each iteration
        .build().unwrap();

    // train model, and print evaluation data
    let bst = Booster::train(&params).unwrap();

    println!("{:?}", bst.predict(&dtest).unwrap());
}

See the examples directory for more detailed examples of different features.

Status

Currently in a very early stage of development, so the API is changing as usability issues occur, or new features are supported.

Builds against XGBoost 0.81.

Platforms

Tested:

  • Linux
  • Mac OS

Unsupported:

  • Windows
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].