I checked all the node tags and output field tag in PMML file, but there is no syntax, datatype mismatching error (I couldn’t share the contents of PMML file due to security issue).
And I found a discussion about this on Nov 23, 2018.
Hi Kiwook,
As you may have read in the Github issue, this really is a bug in KNIME that we are aware of and will fix as soon as possible. In the meantime all I can suggest is that you manually edit the PMML in order to make it valid. The problem is that for Gradient Boosted Trees for classification we internally use regression trees to predict the logits of a softmax. In those regression trees the target field is obviously a number, while the target of the overall model is a string. Hence the error message you got. To fix this, it may be enough to not explicitly specify the target field in the regression models and let JPMML figure that out. Can you remove all MiningField elements with usageType="target" in the MiningSchema of the TreeModel-Elements? As XPath that should be something like: MiningModel/Segmentation/Segment/MiningModel/Segmentation/Segment/TreeModel/MiningSchema/MiningField[@usageType='target'].
Please let me know if this fixes the problem for usage with JPMML.
Kind regards
Alexander
I did remove all the elements that you’ve mentioned and make sure that types are correct.
Once I execute it, the error that I mentioned was gone, but, result was null.
I think there was no target field because I removed all the elements that related to “Target” in PMML file.
Do you have any idea about this?
And, here’s another questions.
If I try to use another model (e.g. logistic regression) instead of using tree model, does that work fine in Java without any modification to PMML file?
Thanks for your time and look forward to hearing from you.
Hi Kiwook,
did you also remove the target in the final RegressionModel that calculates the class? Because there it should stay, I think. It’s rather strange that JPMML returns null when the PMML document seems to be valid.
Concerning your other question: Do you mean replacing the GBT model with logistic regression or replacing the trees inside the GBT? I think a simple logistic regression model should work with JPMML, it is not as powerful as a GBT model, though.
Kind regards
Alexander