Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"message" : "Attribute with value RegressionTable@targetCategory=1 is not valid" #51

Closed
yashwanthmadaka24 opened this issue Jun 20, 2019 · 4 comments

Comments

@yashwanthmadaka24
Copy link

When I am trying to do Model evaluation using POST /model/${id} in single prediction mode, I am getting the below error.

{
"message" : "Attribute with value RegressionTable@targetCategory=1 is not valid"
}

The above error occurs only when my model is in logistic regression. The PMML files of decision tree and random forest are working fine, but I am getting this error only when my model is in logistic regression.

Whats the reason for this error?

@vruusmann
Copy link
Member

Whats the reason for this error?

"Attribute is not valid" - the underlying JPMML-Evaluator library thinks that your logistic regression PMML file is poorly encoded. Specifically, one RegressionTable element refers to a target field category, which doesn't exist (according to the /PMML/DataDictionary/DataField element).

This exception is thrown here:
https://github.com/jpmml/jpmml-evaluator/blob/master/pmml-evaluator/src/main/java/org/jpmml/evaluator/regression/RegressionModelEvaluator.java#L160-L162

@yashwanthmadaka24
Copy link
Author

Whats the reason for this error?

"Attribute is not valid" - the underlying JPMML-Evaluator library thinks that your logistic regression PMML file is poorly encoded. Specifically, one RegressionTable element refers to a target field category, which doesn't exist (according to the /PMML/DataDictionary/DataField element).

This exception is thrown here:
https://github.com/jpmml/jpmml-evaluator/blob/master/pmml-evaluator/src/main/java/org/jpmml/evaluator/regression/RegressionModelEvaluator.java#L160-L162

When I tried with the same model file 3 months back, I was able to do it. But now, I am facing this error with the same file which worked perfectly fine before. How can I fix this error?

@vruusmann
Copy link
Member

When I tried with the same model file 3 months back

BS. This check has been there for ages.

How can I fix this error?

Use a proper PMML conversion software. For example, anything from the JPMML family of libraries would be perfect.

Speaking about this specific file, then you can tweak the value of this one problematic RegressionTable@targetCategory attribute manually. You should already have the line number (in the log file).

@yashwanthmadaka24
Copy link
Author

When I tried with the same model file 3 months back

BS. This check has been there for ages.

How can I fix this error?

Use a proper PMML conversion software. For example, anything from the JPMML family of libraries would be perfect.

Speaking about this specific file, then you can tweak the value of this one problematic RegressionTable@targetCategory attribute manually. You should already have the line number (in the log file).

I had used the pyspark2pmml library(https://github.com/jpmml/pyspark2pmml) for my pmml conversion.
To what value should I tweak the value of that RegressionTable@targetCategory attribute?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants