popcorn / xgb2cpp

Converts XGBoost raw model dumps to C++ code.
MIT License
64 stars 26 forks source link

XGBRegression gives constant difference #7

Open ilkot opened 3 years ago

ilkot commented 3 years ago

Hello, thanks for the code, helped a lot! I tried XGBRegressor but it constantly less around 0.5 than python predictions

I checked dump_raw.txt vs xgb_regressor.cpp numbers have same decimals, so it shouldn't be a problem

Do you have any idea why?

DotaSF commented 3 years ago

Have you find the problem? I met the same situation as yours. and i can't find any useful information from the source code.

ilkot commented 3 years ago

@DotaSF unfortunately not, I just add 0.5 constantly.

gitDawn commented 1 year ago

The method dump_model specify that it can't be loaded back into a model. See below. Maybe this git is outdated.

(method) def dump_model( fout: str | PathLike, fmap: str | PathLike = '', with_stats: bool = False, dump_format: str = "text" ) -> None Dump model into a text or JSON file. Unlike save_model, the output format is primarily used for visualization or interpretation, hence it's more human readable but cannot be loaded back to XGBoost.