secure-xgboost icon indicating copy to clipboard operation
secure-xgboost copied to clipboard

XGBRegressor prediction example

Open wangsu502 opened this issue 4 years ago • 3 comments

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

wangsu502 avatar Dec 02 '20 08:12 wangsu502

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.

podcastinator avatar Dec 03 '20 00:12 podcastinator

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.

wangsu502 avatar Dec 03 '20 02:12 wangsu502

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:

  • create the DMatrix objects from encrypted files, similar to what's done in the demo
  • make sure that the code does not invoke any unsupported Booster APIs (it probably doesn't, but we haven't checked)

podcastinator avatar Dec 03 '20 04:12 podcastinator