Hi PB,
>
> Here is the simple code I am using for prediction (using pymml):
>
Open the DecisionTreeIris.pmml file in text editor, and verify that it
does contain the "variety" field as a target (aka prediction-class).
It's under the /PMML/TreeModel/MiningSchema element:
<MiningSchema>
<MiningField name="variety" usageType="target"/>
</MiningSchema>
Additionally, you're seeing three probability-type output fields, one
for each category level of the categorical target field:
Therefore, the (SkLearn2)PMML converter is doing its job correctly.
> Any idea what I am doing wrong here?
> or is my expectation wrong about the prediction-class?
>
You're using the wrong tool for evaluating the PMML file.
Please switch to JPMML-Evaluator-Python, and everything will work as
advertised/expected:
https://github.com/jpmml/jpmml-evaluator-python
Please note that the main entry method is called "evaluate". It's so
by design, because by performing "evaluate" you shall obtain combined
"predict" and "predict_proba" results.
Append this to your demo script:
<python>
from jpmml_evaluator import make_evaluator
from jpmml_evaluator.pyjnius import jnius_configure_classpath, PyJNIusBackend
# Configure JVM
jnius_configure_classpath()
# Construct a PyJNIus backend
backend = PyJNIusBackend()
evaluator = make_evaluator(backend, "DecisionTreeIris.pmml") \
.verify()
results = evaluator.evaluateAll(iris_df)
print(results)
</python>
VR