mc2-project / secure-xgboost

Secure collaborative training and inference for XGBoost.
https://mc2-project.github.io/secure-xgboost/
Apache License 2.0
105 stars 32 forks source link

XGBRegressor prediction example #131

Open wangsu502 opened 3 years ago

wangsu502 commented 3 years ago

Hi Guys, Could you provide a basic prediction example with (XGBRegressor module? thanks

podcastinator commented 3 years ago

Hi, We don't fully support XGBRegressor yet. It requires a few changes such as (i) the DMatrix objects need to be initialized using encrypted files; (ii) make sure it doesn't invoke any unsupported Booster APIs. Leaving this issue open so that this remains on our radar.

wangsu502 commented 3 years ago

Hi Rishabh, thanks for the reply. So could you provide a list of what the current implementation can do? XGBRegressor is critical. I'm glad to join the development if need.

podcastinator commented 3 years ago

Oh that would be great! We'd appreciate it if you could contribute!

Currently, this is the API we support: https://secure-xgboost.readthedocs.io/en/latest/python/python_api.html Basically, we support a large subset of the core Booster API, but not any of the sklearn wrappers around it. In summary, we can currently create DMatrix objects from encrypted files, train a Booster model, run predictions, and save/load the model to an encrypted file. This demo file contains an example: https://github.com/mc2-project/secure-xgboost/blob/master/demo/python/basic/secure-xgboost-demo.py

To add support for XGBRegressor, you would probably need to do the following: