Closed OnlyFor closed 4 years ago
IIRC, the JPMML-LightGBM library does not check the value of the boosting_type
attribute.
Therefore, it encodes "gbdt" and "rf" boosting types identically, following the "gbdt" procedure. Based on the above evidence, there is a need to detect "rf" boosting type, and do something differently.
thx,
different boosting_types can be found in https://lightgbm.readthedocs.io/en/latest/pythonapi/lightgbm.LGBMClassifier.html
boosting_type (string, optional (default='gbdt')) – ‘gbdt’, traditional Gradient Boosting Decision Tree. ‘dart’, Dropouts meet Multiple Additive Regression Trees. ‘goss’, Gradient-based One-Side Sampling. ‘rf’, Random Forest.
@OnlyFor Open model2.pmml
in text editor, and on line 143 change the value of Segmentation@multipleModelMethod
attribute from sum
(gbdt) to average
(rf).
Then you have correct RF predictions.
@vruusmann it works ! thx !
it works!
Just made this comment to show that the fix for "rf" booster type is really simple. Will probably implement it in code later this week.
Here is my code,
java -cp pmml-evaluator-example-executable-1.4.12.jar org.jpmml.evaluator.EvaluationExample --model model1.pmml --input input.csv --output output1.csv --missing-values "" --separator ","
probability(1) == model1_p1
java -cp pmml-evaluator-example-executable-1.4.12.jar org.jpmml.evaluator.EvaluationExample --model model2.pmml --input input.csv --output output2.csv --missing-values "" --separator ","
probability(1) != model2_p1 :( ???