Evaluating Logistic Regression with categorical variables

223 views
Skip to first unread message

Ankur Chouragade

unread,
May 4, 2015, 3:13:42 AM5/4/15
to jp...@googlegroups.com
I have created a Logistic Regression model for a dataset with a categorical variable in it. The resulting pmml file includes this in the element FactorList and creates one parameter for every category in the element ParameterList. I have created this using R
But when I try to evaluate the dataset using jpmml i get the following error message

org.jpmml.evaluator.InvalidResultException (at or around line 23)
at org.jpmml.evaluator.ArgumentUtil.prepare(ArgumentUtil.java:124)
at org.jpmml.evaluator.ModelEvaluator.prepare(ModelEvaluator.java:110)
at src.ModelExecutor.evaluate(ModelExecutor.java:97)
at src.ModelExecutor.execute(ModelExecutor.java:68)
at src.ModelExecutor.main(ModelExecutor.java:45)

Villu Ruusmann

unread,
May 4, 2015, 3:24:23 AM5/4/15
to jpmml
Hi Ankur,

> But when I try to evaluate the dataset using jpmml i get the following error message
>
> org.jpmml.evaluator.InvalidResultException (at or around line 23)
> at org.jpmml.evaluator.ArgumentUtil.prepare(ArgumentUtil.java:124)
> at org.jpmml.evaluator.ModelEvaluator.prepare(ModelEvaluator.java:110)
> at src.ModelExecutor.evaluate(ModelExecutor.java:97)
> at src.ModelExecutor.execute(ModelExecutor.java:68)
> at src.ModelExecutor.main(ModelExecutor.java:45)
>

Your code fails at argument preparation stage. In this case, the
supplied field value does not match the definition of valid field
values, as defined by the DataDictionary/DataField and/or
MiningSchema/MiningField elements.

For example, if the DataDictionary/DataField elements defines that a
categorical field "fruit" can take three values "apple", "orange" and
"lemon", but you invoke the Evaluator#prepare with "pineapple", then
you are bound to encounter an InvalidResultException.


VR

Ankur Chouragade

unread,
May 4, 2015, 7:42:11 AM5/4/15
to jp...@googlegroups.com
Hi Villu,
Thanks! The test data had the problem. Now it is working fine.
Reply all
Reply to author
Forward
0 new messages