{"id":13822767,"url":"https://github.com/davechallis/rust-xgboost","last_synced_at":"2025-12-30T08:59:31.594Z","repository":{"id":41281039,"uuid":"133958518","full_name":"davechallis/rust-xgboost","owner":"davechallis","description":"Rust bindings for XGBoost.","archived":false,"fork":false,"pushed_at":"2024-02-02T13:05:19.000Z","size":110,"stargazers_count":95,"open_issues_count":8,"forks_count":34,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-14T07:20:45.534Z","etag":null,"topics":["ffi","machine-learning","rust","xgboost"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davechallis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-18T13:32:50.000Z","updated_at":"2024-07-17T09:50:32.095Z","dependencies_parsed_at":"2024-01-18T04:08:28.332Z","dependency_job_id":"de2435ae-8422-4fdc-a6e7-08c5fe0f0edc","html_url":"https://github.com/davechallis/rust-xgboost","commit_stats":{"total_commits":88,"total_committers":7,"mean_commits":"12.571428571428571","dds":"0.20454545454545459","last_synced_commit":"20104e1c8d505b1de96af2675501fcfb6140fd9a"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davechallis%2Frust-xgboost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davechallis%2Frust-xgboost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davechallis%2Frust-xgboost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davechallis%2Frust-xgboost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davechallis","download_url":"https://codeload.github.com/davechallis/rust-xgboost/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225443020,"owners_count":17475162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ffi","machine-learning","rust","xgboost"],"created_at":"2024-08-04T08:02:16.366Z","updated_at":"2025-12-30T08:59:31.540Z","avatar_url":"https://github.com/davechallis.png","language":"Rust","funding_links":[],"categories":["Rust","Machine Learning"],"sub_categories":[],"readme":"# rust-xgboost\n\n[![Travis Build Status](https://travis-ci.com/davechallis/rust-xgboost.svg?branch=master)](https://travis-ci.com/davechallis/rust-xgboost)\n[![Documentation link](https://docs.rs/xgboost/badge.svg)](https://docs.rs/xgboost/badge.svg)\n\nRust bindings for the [XGBoost](https://xgboost.ai) gradient boosting library.\n\n* [Documentation](https://docs.rs/xgboost)\n\nBasic usage example:\n\n```rust\nextern crate xgboost;\n\nuse xgboost::{parameters, DMatrix, Booster};\n\nfn main() {\n    // training matrix with 5 training examples and 3 features\n    let x_train = \u0026[1.0, 1.0, 1.0,\n                    1.0, 1.0, 0.0,\n                    1.0, 1.0, 1.0,\n                    0.0, 0.0, 0.0,\n                    1.0, 1.0, 1.0];\n    let num_rows = 5;\n    let y_train = \u0026[1.0, 1.0, 1.0, 0.0, 1.0];\n\n    // convert training data into XGBoost's matrix format\n    let mut dtrain = DMatrix::from_dense(x_train, num_rows).unwrap();\n\n    // set ground truth labels for the training matrix\n    dtrain.set_labels(y_train).unwrap();\n\n    // test matrix with 1 row\n    let x_test = \u0026[0.7, 0.9, 0.6];\n    let num_rows = 1;\n    let y_test = \u0026[1.0];\n    let mut dtest = DMatrix::from_dense(x_test, num_rows).unwrap();\n    dtest.set_labels(y_test).unwrap();\n\n    // configure objectives, metrics, etc.\n    let learning_params = parameters::learning::LearningTaskParametersBuilder::default()\n        .objective(parameters::learning::Objective::BinaryLogistic)\n        .build().unwrap();\n\n    // configure the tree-based learning model's parameters\n    let tree_params = parameters::tree::TreeBoosterParametersBuilder::default()\n            .max_depth(2)\n            .eta(1.0)\n            .build().unwrap();\n\n    // overall configuration for Booster\n    let booster_params = parameters::BoosterParametersBuilder::default()\n        .booster_type(parameters::BoosterType::Tree(tree_params))\n        .learning_params(learning_params)\n        .verbose(true)\n        .build().unwrap();\n\n    // specify datasets to evaluate against during training\n    let evaluation_sets = \u0026[(\u0026dtrain, \"train\"), (\u0026dtest, \"test\")];\n\n    // overall configuration for training/evaluation\n    let params = parameters::TrainingParametersBuilder::default()\n        .dtrain(\u0026dtrain)                         // dataset to train with\n        .boost_rounds(2)                         // number of training iterations\n        .booster_params(booster_params)          // model parameters\n        .evaluation_sets(Some(evaluation_sets)) // optional datasets to evaluate against in each iteration\n        .build().unwrap();\n\n    // train model, and print evaluation data\n    let bst = Booster::train(\u0026params).unwrap();\n\n    println!(\"{:?}\", bst.predict(\u0026dtest).unwrap());\n}\n```\n\nSee the [examples](https://github.com/davechallis/rust-xgboost/tree/master/examples) directory for\nmore detailed examples of different features.\n\n## Status\n\nCurrently in a very early stage of development, so the API is changing as usability issues occur,\nor new features are supported.\n\nBuilds against XGBoost 0.81.\n\n### Platforms\n\nTested:\n\n* Linux\n* Mac OS\n\nUnsupported:\n\n* Windows\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavechallis%2Frust-xgboost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavechallis%2Frust-xgboost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavechallis%2Frust-xgboost/lists"}