dmitryikh / leaves

pure Go implementation of prediction part for GBRT (Gradient Boosting Regression Trees) models from popular frameworks
MIT License
427 stars 72 forks source link

Read json format of gbtree and gblinear #81

Open tonylee19544 opened 3 years ago

tonylee19544 commented 3 years ago

This will add support for json format and binary format of gbtree and gblinear which have the version not younger than v1.0.0

dmitryikh commented 3 years ago

@tonylee19544 , great job! That's definitely what leaves needs!

I will come back yo you with review after the easter holidays.

tonylee19544 commented 3 years ago

Hi would like to ask if there is some news for the pull request. Thanks.

bgweber commented 3 years ago

@dmitryikh Can you review? Super useful library and the json bindings help modernize!

ruthlee commented 2 years ago

Yes!! Would love to see this merged @dmitryikh

adensur commented 2 years ago

Have a problem with this pull request. I have an xgboost model trained with version 1.6.0. Training code: https://gist.github.com/adensur/134b82c304cc69eed278e258e6b2a685 json read error: json: cannot unmarshal number into Go struct field Tree.learner.gradient_booster.model.trees.default_left of type bool "default_left" field in tree nodes are ints (in current xgboost version, at least), not bools. After fixing that, the prediction result is incorrect. I don't understand where this formula is coming from: https://github.com/dmitryikh/leaves/pull/81/files#diff-c524a0589fd250b78ba6e81dbd14998971af6ea9fd8dd2aad8c2dd8e3ecf6a4dR334 But without it prediction is correct, in my case at least