在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:popcorn/xgb2cpp开源软件地址:https://github.com/popcorn/xgb2cpp开源编程语言:Python 100.0%开源软件介绍:xgb2cppxgb2cpp converts XGBoost raw text dump to C++ code that you can use in your C++ projects. READ FIRSTThis code (atm) only works on XGB models trained with 'multi:softprob' objective. 'multi:softprob' objective tells XGBoost to train trees in "1 vs. all" fashion. If you want it to work with 'binary:logistic' or 'binary:logitraw' you'll have to tweak code-generating Python script a bit or wait for me to implement it. How to run it?Use generate_cpp_code.py script to generate xgboost_classifier.cpp. Generated xgboost_classifier.cpp will contain xgb_classify() function that you can use to classify samples. In folder sample you can find main.cpp and xgboost_classifier.h files that form use case project. Also, there is a pima-indian-diabetes dataset that I used to generate dummy model. File /sample/pima-indians-diabetes/train.py trains XGB model and creates dump.raw.txt which is raw text representation of trained model. Example run:
If you have any questions or improvements just open issue and I'll be on it. Thanks |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论