Closed PowerToThePeople111 closed 1 year ago
"Field \"pmml(pred)\" is not defined"
The PMML conversion process is OK, the PMML document is OK, and the PMML evaluation process is OK too.
The problem is that your input data record is NOT OK - it contains one or more missing values, and therefore the logistic regression (LR) model element evaluates to a missing value.
Your LR is trying to perform extra processing on this missing prediction, and therefore fails with error. Think of it as a Java's NullPointerException
- can't perform an operation on a null
object reference.
openscoring master (also tested on 2.0.4)
IIRC, the handling of missing predictions was improved in recent JPMML-Evaluator library versions. If the LR model evaluates to a missing value, then its Output
element is not evaluated at all.
If you upgrade to the latest Openscoring 2.1(.1) version, do you get a more meaningful error?
How to debug:
Thank you so much!
The problem was not with the model file itself but with a feature that i put into it.
The problem was not with the model file itself but with a feature that i put into it.
Just remembered that the Openscoring service is supposed to issue a warning when it encounters a missing input value: https://github.com/openscoring/openscoring/blob/2.1.1/openscoring-service/src/main/java/org/openscoring/service/ModelResource.java#L467-L470
Check your log file!
Hey,
i did not see that message but that is due to my own fault: I have rewritten and added different functions in the ModelResource class. The part that was doing the check was commented out - which was fine for the first iteration of my models where i tailored the modifications to the needs of my models. But now that they changed, I ran into this problem.
If I had kept that logic which you added there, I would not have stumbled into that issue.
Hi Villu,
I got a spark pipeline doing several data preprocessing steps with a final logistic regression and exported that successfully to a pmml file. When loading it in the openscoring server and trying to produce a prediction, I get the following message:
"Field \"pmml(pred)\" is not defined"
I read through (I guess) all of the issues in your repositories and found that this kind of message is expected when the undefined column is used in a following segment of the pipeline. But actually
pred
is the output of the final logistic regression.If you have no idea about why that could happen in mind, please ignore my request. I am kind of in a hurry work-wise which is why I have problems making an example for you to run. I am just hoping for a pointer into the right direction.
I have ...
This is the beginning of the pmml file: