dp-xgboost
Science Score: 28.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.6%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: sarus-tech
- License: apache-2.0
- Language: C++
- Default Branch: master
- Size: 2.26 MB
Statistics
- Stars: 23
- Watchers: 4
- Forks: 9
- Open Issues: 4
- Releases: 4
Metadata Files
README.md
What is Sarus DP-XGBoost?
This is a fork of XGBoost that aims at adding differential-privacy to gradient boosted trees.
A detailed explanation of the theory and methods used can be found in: Grislain, Nicolas and Joan Gonzalvez. “DP-XGBoost: Private Machine Learning at Scale.” (2021)..
Quick Start
You can start using dp-xgboost with the following notebook.
Other Python examples which build a DP model are given in sarus/python/.
Installing Sarus DP-XGBoost
To install DP-XGBoost simply run:
pip install dp-xgboost
Usage
Python examples which build a DP model are given in sarus/python/.
The main parameters involved in DP learning are:
- tree_method which must be set to approxDP to use Sarus XGBoost DP tree learning.
- dp_epsilon_per_tree: the privacy budget of a single tree.
- min_child_weight: the minimum weight needed to construct a leaf, this influences the DP noise.
- subsample: the fraction of the dataset randomly sampled to each tree, subsampling improve the privacy.
- num_boost_rounds: the number of trees built.
The privacy queries used during training are stored in the model and accessible via
booster.save_model().
Privacy consumption
Note that the total privacy consumption of the boosted trees is given by:
$$n \log{ \left( 1 + \gamma(e^{\epsilon} - 1) \right) }$$
Where $n$ is the number of trees, $\gamma$ the subsample fraction (between 0 and 1), and $\epsilon$
is the budget per tree. You can refer to our explaining article in doc/sarus for more details on privacy consumption.
Differential Privacy in the C++ library
DP is added at three levels in the XGBoost C++ shared library (under the src repo): to construct sketches (with a histogram query), for split selection (with an exponential mech), and for leaf values (with a Laplace mechanism). The mechanisms are located in
include/xgboost/mechanisms.h.
Relevant classes are in the src/tree/updater_histmaker.cc file and especially the DPHistMaker class which is the DP tree updater called when setting approxDP as tree_method param in XGBoost.
Building for the JVM
To use with Spark, please follow https://xgboost.readthedocs.io/en/latest/jvm/xgboost4jsparktutorial.html.
- Needed: Java JDK 1.8, Spark 2.12, Maven 3
- Set the JAVAHOME env variable first: `export JAVAHOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home/`
- In the
jvm-packagesfolder runmvn package install -DskipTests -Dmaven.test.skip=true
This should build the jars xgboost4j and xgboost4j-spark which will then be passed to
spark-submit. The sarus/spark folder contains an example of Spark project in Scala with a POM file that should compile and launch Sarus XGBoost with 2 workers.
Developer guide
- Get the submodules (s.a. dmlc)
shell
git submodule sync
git submodule update --init --recursive
- (Optional) Install prerequisites (s.a.
cmake,g++,libomp - Build
shell
mkdir build
cd build
cmake ..
Owner
- Name: Sarus Technologies
- Login: sarus-tech
- Kind: organization
- Location: Paris, France
- Website: https://sarus.tech
- Twitter: Sarus_tech
- Repositories: 4
- Profile: https://github.com/sarus-tech
Citation (CITATION)
@inproceedings{Chen:2016:XST:2939672.2939785,
author = {Chen, Tianqi and Guestrin, Carlos},
title = {{XGBoost}: A Scalable Tree Boosting System},
booktitle = {Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining},
series = {KDD '16},
year = {2016},
isbn = {978-1-4503-4232-2},
location = {San Francisco, California, USA},
pages = {785--794},
numpages = {10},
url = {http://doi.acm.org/10.1145/2939672.2939785},
doi = {10.1145/2939672.2939785},
acmid = {2939785},
publisher = {ACM},
address = {New York, NY, USA},
keywords = {large-scale machine learning},
}
GitHub Events
Total
- Fork event: 1
Last Year
- Fork event: 1
Committers
Last synced: over 3 years ago
All Time
- Total Commits: 44
- Total Committers: 3
- Avg Commits per committer: 14.667
- Development Distribution Score (DDS): 0.091
Top Committers
| Name | Commits | |
|---|---|---|
| Nicolas Grislain | N****n@g****m | 40 |
| Nicolas Grislain | ng@s****h | 3 |
| Joan Gonzalvez | jg@s****h | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 6
- Total pull requests: 1
- Average time to close issues: about 8 hours
- Average time to close pull requests: 1 day
- Total issue authors: 5
- Total pull request authors: 1
- Average comments per issue: 0.5
- Average comments per pull request: 1.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 1
- Pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- erchiw (2)
- boudewijndegooijer (1)
- NDanies (1)
- z-a-f (1)
- 1853582 (1)
Pull Request Authors
- z-a-f (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 148 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 6
- Total maintainers: 1
pypi.org: dp-xgboost
DP-XGBoost Python Package from Sarus
- Homepage: https://github.com/sarus-tech/dp-xgboost
- Documentation: https://dp-xgboost.readthedocs.io/
- License: Apache-2.0
-
Latest release: 0.2.10
published over 2 years ago