{"id":13641423,"url":"https://github.com/mesalock-linux/gbdt-rs","last_synced_at":"2026-04-06T06:04:21.454Z","repository":{"id":33788934,"uuid":"162353417","full_name":"mesalock-linux/gbdt-rs","owner":"mesalock-linux","description":"MesaTEE GBDT-RS : a fast and secure GBDT library, supporting TEEs such as Intel SGX and ARM TrustZone","archived":false,"fork":false,"pushed_at":"2025-01-29T18:49:13.000Z","size":917,"stargazers_count":223,"open_issues_count":8,"forks_count":32,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-11-07T02:18:20.964Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mesalock-linux.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2018-12-18T22:37:28.000Z","updated_at":"2025-10-26T20:34:24.000Z","dependencies_parsed_at":"2024-01-14T11:13:51.778Z","dependency_job_id":"5ce2d173-f278-4e2e-9b7c-8cb8d47e7422","html_url":"https://github.com/mesalock-linux/gbdt-rs","commit_stats":{"total_commits":46,"total_committers":6,"mean_commits":7.666666666666667,"dds":"0.23913043478260865","last_synced_commit":"14e455e10d37a551f436e05272ea29ebf55ae041"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mesalock-linux/gbdt-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mesalock-linux%2Fgbdt-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mesalock-linux%2Fgbdt-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mesalock-linux%2Fgbdt-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mesalock-linux%2Fgbdt-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mesalock-linux","download_url":"https://codeload.github.com/mesalock-linux/gbdt-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mesalock-linux%2Fgbdt-rs/sbom","scorecard":{"id":637164,"data":{"date":"2025-08-11","repo":{"name":"github.com/mesalock-linux/gbdt-rs","commit":"594194af697ca10b6f83cf514536bc992d476b9b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":2,"reason":"Found 6/24 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T09:32:55.588Z","repository_id":33788934,"created_at":"2025-08-21T09:32:55.589Z","updated_at":"2025-08-21T09:32:55.589Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31461534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-08-02T01:01:20.603Z","updated_at":"2026-04-06T06:04:21.423Z","avatar_url":"https://github.com/mesalock-linux.png","language":"Rust","funding_links":[],"categories":["Machine Learning","梯度提升和树模型"],"sub_categories":["Library OSes and SDKs"],"readme":"# MesaTEE GBDT-RS : a fast and secure GBDT library, supporting TEEs such as Intel SGX and ARM TrustZone\n\n[![Build Status](https://ci.mesalock-linux.org/api/badges/mesalock-linux/gbdt-rs/status.svg)](https://ci.mesalock-linux.org/mesalock-linux/gbdt-rs)\n[![codecov](https://codecov.io/gh/mesalock-linux/gbdt-rs/branch/master/graph/badge.svg)](https://codecov.io/gh/mesalock-linux/gbdt-rs)\n\nMesaTEE GBDT-RS is a gradient boost decision tree library written in Safe Rust. There is no unsafe rust code in the library. \n\nMesaTEE GBDT-RS provides the training and inference capabilities. And it can use the models trained by [xgboost](https://xgboost.readthedocs.io/en/latest/) to do inference tasks.\n\nNew! The MesaTEE GBDT-RS [paper](gbdt.pdf) has been [accepted by IEEE S\u0026P'19](https://www.ieee-security.org/TC/SP2019/program-posters.html)!\n\n\n# Supported Task\n## Supppoted task for both training and inference\n1. Linear regression: use SquaredError and LAD loss types \n2. Binary classification (labeled with 1 and -1): use LogLikelyhood loss type\n## Compatibility with xgboost \nAt this time, MesaTEE GBDT-RS support to use model trained by xgboost to do inference.  The model should be trained by xgboost with following configruation:\n\n1. booster: gbtree\n2. objective: \"reg:linear\", \"reg:logistic\", \"binary:logistic\", \"binary:logitraw\", \"multi:softprob\", \"multi:softmax\" or \"rank:pairwise\".\n\nWe have tested that MesaTEE GBDT-RS is compatible with xgboost 0.81 and 0.82\n\n# Quick Start\n## Training Steps\n1. Set configuration\n2. Load training data\n3. Train the model\n4. (optional) Save the model\n\n## Inference Steps\n1. Load the model\n2. Load the test data\n3. Inference the test data\n\n## Example\n``` rust\n    use gbdt::config::Config;\n    use gbdt::decision_tree::{DataVec, PredVec};\n    use gbdt::gradient_boost::GBDT;\n    use gbdt::input::{InputFormat, load};\n\n    let mut cfg = Config::new();\n    cfg.set_feature_size(22);\n    cfg.set_max_depth(3);\n    cfg.set_iterations(50);\n    cfg.set_shrinkage(0.1);\n    cfg.set_loss(\"LogLikelyhood\"); \n    cfg.set_debug(true);\n    cfg.set_data_sample_ratio(1.0);\n    cfg.set_feature_sample_ratio(1.0);\n    cfg.set_training_optimization_level(2);\n\n    // load data\n    let train_file = \"dataset/agaricus-lepiota/train.txt\";\n    let test_file = \"dataset/agaricus-lepiota/test.txt\";\n\n    let mut input_format = InputFormat::csv_format();\n    input_format.set_feature_size(22);\n    input_format.set_label_index(22);\n    let mut train_dv: DataVec = load(train_file, input_format).expect(\"failed to load training data\");\n    let test_dv: DataVec = load(test_file, input_format).expect(\"failed to load test data\");\n\n    // train and save model\n    let mut gbdt = GBDT::new(\u0026cfg);\n    gbdt.fit(\u0026mut train_dv);\n    gbdt.save_model(\"gbdt.model\").expect(\"failed to save the model\");\n\n    // load model and do inference\n    let model = GBDT::load_model(\"gbdt.model\").expect(\"failed to load the model\");\n    let predicted: PredVec = model.predict(\u0026test_dv);\n```\n## Example code\n* Linear regression: examples/iris.rs\n*  Binary classification: examples/agaricus-lepiota.rs\n\n# Use models trained by xgboost\n\n## Steps\n1. Use xgboost to train a model\n2. Use examples/convert_xgboost.py to convert the model\n    * Usage: python convert_xgboost.py xgboost_model_path objective output_path\n    * Note convert_xgboost.py depends on xgboost python libraries. The converted model can be used on machines without xgboost\n3. In rust code, call GBDT::load_from_xgboost(model_path, objective) to load the model\n4. Do inference\n5. (optional) Call GBDT::save_model to save the model to MesaTEE GBDT-RS native format. \n\n## Example code\n* \"reg:linear\": examples/test-xgb-reg-linear.rs\n* \"reg:logistic\": examples/test-xgb-reg-logistic.rs\n* \"binary:logistic\": examples/test-xgb-binary-logistic.rs \n* \"binary:logitraw\": examples/test-xgb-binary-logistic.rs \n* \"multi:softprob\": examples/test-xgb-multi-softprob.rs\n* \"multi:softmax\": examples/test-xgb-multi-softmax.rs \n* \"rank:pairwise\": examples/test-xgb-rank-pairwise.rs\n\n# Multi-threading\n## Training:\nAt this time, training in MesaTEE GBDT-RS is single-threaded.\n## Inference:\nThe related inference functions are single-threaded. But they are thread-safe. We provide an inference example using multi threads in example/test-multithreads.rs\n\n# SGX usage\nBecause MesaTEE GBDT-RS is written in pure rust, with the help of [rust-sgx-sdk](https://github.com/baidu/rust-sgx-sdk), it can be used in sgx enclave easily as:\n\n```\ngbdt_sgx = { git = \"https://github.com/mesalock-linux/gbdt-rs\" }\n```\n\nThis would import a crate named `gbdt_sgx`. If you prefer `gbdt` as normal:\n\n```\ngbdt = { package = \"gbdt_sgx\", git = \"https://github.com/mesalock-linux/gbdt-rs\" }\n```\n\nFor more information and concret examples, please look at directory `sgx/gbdt-sgx-test`.\n\n# License\n\nApache 2.0\n\n# Authors\n\nTianyi Li @n0b0dyCN \u003cn0b0dypku@gmail.com\u003e\n\nTongxin Li @litongxin1991 \u003clitongxin1991@gmail.com\u003e\n\nYu Ding @dingelish \u003cdingelish@gmail.com\u003e\n\n# Steering Committee\nTao Wei, Yulong Zhang\n\n# Acknowledgment\n\nThanks to @qiyiping for his/her great previous work [gbdt](https://github.com/qiyiping/gbdt). We read his/her code before starting this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmesalock-linux%2Fgbdt-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmesalock-linux%2Fgbdt-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmesalock-linux%2Fgbdt-rs/lists"}