Open ahmed-shariff opened 4 years ago
This is a legit bug now - child model translators (TreeModel
element) should be inheriting the list of target categories from the parent model translator (MiningModel
element), but they don't.
This bug seems to manifest itself when the data type of the target field is something else than string
(in your sample PMML file the data type of the "class" field is double
).
As a workaround, you should change the data type of the "class" data column to string, and re-train the model. It should work then.
A proper fix is already implemented in the JPMML-Evaluator library version 1.5.0-SNAPSHOT (current development branch, not a release version). It should be published in a week or two.
This bug affects Scikit-Learn's RandomForestClassifier
. It shouldn't affect any other model type.
Thank you very much
The problem still seems to persist with the newer versions: I tried re-running some of the random-forest models with the class datatype set to int/double and also set to strings. And I am still getting the same error.
The issue is still in "open" state, which indicates that I haven't had time to work on it yet.
The JPMML-Evaluator library version 1.5(.1) introduced the required groundwork, but there's still a minor JPMML-Transpiler code change needed.
For some models exported with jpmml-sklearn, when I am running the transpiler I get the following exception:
The pmml and pickle file of the model in question: file.zip