Closed bbzzzz closed 7 years ago
SEVERE: Failed to convert java.lang.IllegalArgumentException: Field device_type has valid values [ANDROID, CHROMEOS, IPAD, IPHONE, IPOD, LINUX, MAC, WINDOWS] at org.jpmml.converter.PMMLEncoder.toCategorical(PMMLEncoder.java:189)
This exception means that the LabelEncoder
transformation is trying to define the valid value space for the field device_type
, but the information that it has is in conflict with the existing information. As a matter of caution, the sklearn2pmml
package refuses to continue (in order to avoid generating potentially problematic PMML).
In other words, it means that CategoricalDomain
and LabelEncoder
transformations are seeing a different set of valid values.
array([u'WINDOWS', u'ANDROID', u'MAC', u'IPHONE', u'IPAD', u'CHROMEOS',nan, u'LINUX', u'IPOD'], dtype=object)
Your column is a mix of string and numeric (float64
?) values.
To fix the problem, convert nan
values to None
values, so that the column is all string values.
Thank you for your quick reply!
Hi,
I got the following error when trying to generate PMML file:
It seems the problem is related with column
device_type
.My data:
Values in column
device_type
:If I delete
device_type
, then PMML file can be successfully generated (another categorical columnweekday
does not contain missing values)Here is my code for generating PMML:
Mapper:
Pipeline:
There is no problem in
pipeline.fit(X,y)
, I got:Thanks, Bohan