Closed simon19891101 closed 3 years ago
Hi there, I also retrained a model (latest Master) on the Microsoft Learning to Rank dataset (https://www.microsoft.com/en-us/research/project/mslr/). The results between the original model and treelite are almost the same however not 100%:
lgb_out_pred = gbm.predict(val_df).reshape(1,-1)
batch = treelite_runtime.DMatrix(val_df, 'double')
out_pred = predictor.predict(batch).reshape(1,-1)
When I converted this task to a binary classification by taking labels >= 2 as "1" else "0", the same thing happened though for classifications the predicted labels are treated as the same...
lgb_out_pred = gbm_clf.predict_proba(val_df)[:,1].reshape(1,-1)
batch = treelite_runtime.DMatrix(val_df, 'double')
out_pred = predictor.predict(batch).reshape(1,-1)
Keen to know your thoughts. Thanks a lot :)
@simon19891101 Are you using the latest mainline
branch of Treelite? The line
batch = treelite_runtime.DMatrix(val_df, 'double')
should be revised to
batch = treelite_runtime.DMatrix(val_df, dtype='float64')
This is great! I tried it and it worked this time! Thank you very much for the help.
Hi there, I'm trying to reduce the inference time of LightGBM (LambdaMART) and was really impressed by the speed increase. However, the predictions of treelite look totally different from the original LightGBM. My script is:
with results printed below:
I used lightgbm 3.0.0 and installed the latest treelite via python3 -m pip install --user treelite treelite_runtime. I also tried git clone and installed from source however the predictions are still wrong.
The files ('lgbm_lv_128_32.txt' and 'val_df.npz') to reproduce the results can be accessed here: https://drive.google.com/drive/folders/1K2audmHyzIEHMhCSPX6k3NPduut3OMqr?usp=sharing
It would be awesome to get your thoughts! Thank you very much.