You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
then i try convert into pmml format by this: java -jar jpmml-sklearn-1.5.9.jar --pkl-input pipeline.pkl.z --pmml-output pipeline.pmml
and i catch next exception:
янв 14, 2019 3:12:03 PM org.jpmml.sklearn.Main run
INFO: Parsing PKL..
янв 14, 2019 3:12:03 PM org.jpmml.sklearn.Main run
INFO: Parsed PKL in 31 ms.
янв 14, 2019 3:12:03 PM org.jpmml.sklearn.Main run
INFO: Converting..
янв 14, 2019 3:12:03 PM org.jpmml.sklearn.Main run
SEVERE: Failed to convert
java.lang.IllegalArgumentException: Tuple contains an unsupported value (Python class sklearn.feature_extraction.text.TfidfVectorizer)
at org.jpmml.sklearn.CastFunction.apply(CastFunction.java:43)
at org.jpmml.sklearn.TupleUtil.extractElement(TupleUtil.java:48)
at sklearn2pmml.pipeline.PMMLPipeline.getEstimator(PMMLPipeline.java:535)
at sklearn2pmml.pipeline.PMMLPipeline.encodePMML(PMMLPipeline.java:97)
at org.jpmml.sklearn.Main.run(Main.java:145)
at org.jpmml.sklearn.Main.main(Main.java:94)
Caused by: java.lang.ClassCastException: Cannot cast sklearn.feature_extraction.text.TfidfVectorizer to sklearn.Estimator
at java.lang.Class.cast(Class.java:3369)
at org.jpmml.sklearn.CastFunction.apply(CastFunction.java:41)
... 5 more
Exception in thread "main" java.lang.IllegalArgumentException: Tuple contains an unsupported value (Python class sklearn.feature_extraction.text.TfidfVectorizer)
at org.jpmml.sklearn.CastFunction.apply(CastFunction.java:43)
at org.jpmml.sklearn.TupleUtil.extractElement(TupleUtil.java:48)
at sklearn2pmml.pipeline.PMMLPipeline.getEstimator(PMMLPipeline.java:535)
at sklearn2pmml.pipeline.PMMLPipeline.encodePMML(PMMLPipeline.java:97)
at org.jpmml.sklearn.Main.run(Main.java:145)
at org.jpmml.sklearn.Main.main(Main.java:94)
Caused by: java.lang.ClassCastException: Cannot cast sklearn.feature_extraction.text.TfidfVectorizer to sklearn.Estimator
at java.lang.Class.cast(Class.java:3369)
at org.jpmml.sklearn.CastFunction.apply(CastFunction.java:41)
... 5 more
The text was updated successfully, but these errors were encountered:
The exception happens in method PMMLPipeline#getEstimator(), where the converter is inspecting the last step of the pipeline, and expects to find some Scikit-Learn estimator object there.
You have a Scikit-Learn transformer (TfidfVectorizer) as the last step instead. Such transformation-only pipelines are currently not supported: jpmml/jpmml-sklearn#86 jpmml/jpmml-evaluator#96
Currently, this is a usability bug - the PMMLPipeline#getEstimator() method should detect this "the last pipeline step is (a transformer object) not an estimator object" case, and emit a more informative error message.
I use:
sckitlearn 0.20.1
python 3.6
jpmml 1.5.9
sklearn2pmml 0.40.0
I try this:
then i try convert into pmml format by this:
java -jar jpmml-sklearn-1.5.9.jar --pkl-input pipeline.pkl.z --pmml-output pipeline.pmml
and i catch next exception:
The text was updated successfully, but these errors were encountered: