microsoft / LightGBM

A fast, distributed, high performance gradient boosting (GBT, GBDT, GBRT, GBM or MART) framework based on decision tree algorithms, used for ranking, classification and many other machine learning tasks.
https://lightgbm.readthedocs.io/en/latest/
MIT License
16.56k stars 3.82k forks source link

is there a c++ example of lightgbm predict calling python trained model? I can not find the c++ api that predict data by one row #1866

Closed xiaopangjun closed 5 years ago

xiaopangjun commented 5 years ago

Environment info

Operating System: linux

CPU/GPU model:cpu

C++/Python/R version: c++

question

I trained a lightgbm model in python, and saved as a model file, then I want to predict new data in C++. I search in the web but cannot find a good example.

guolinke commented 5 years ago

you can use the trained model files, with compiled lightgbm execute files (like exe) to run your prediciton. refer to https://github.com/Microsoft/LightGBM/tree/master/examples/binary_classification#prediction