Convert XGBoost dump file to .py
For instuctions, you may read this article: https://towardsdatascience.com/xgboost-deployment-made-easy-6e11f4b3f817
- The codes work well under python 3.5.2 + xgboost 0.6. It's not guranteed to generate correct results for other versions.
- I haven't done any error handling in my codes.
- The .py is designed for scoring python dictionaries, but you can do a little bit revisions to suit for your own use case.
- Before you generate the .py file, make sure there's no .py file with the same name in the target folder.