Reputation: 73
I am getting the following error while trying to convert a PipeLine Model in spark to Pmml using JPmml.
java.lang.NoSuchMethodError: org.dmg.pmml.MiningField.setUsageType(Lorg/dmg/pmml/MiningField$UsageType;)Lorg/dmg/pmml/MiningField;
I have added all the dependencies regarding JPmml.
// https://mvnrepository.com/artifact/org.jpmml/jpmml-sparkml libraryDependencies += "org.jpmml" % "jpmml-sparkml" % "1.1.6"
// https://mvnrepository.com/artifact/org.jpmml/pmml-model libraryDependencies += "org.jpmml" % "pmml-model" % "1.3.6"
// https://mvnrepository.com/artifact/org.jpmml/pmml-evaluator libraryDependencies += "org.jpmml" % "pmml-evaluator" % "1.3.5"
Upvotes: 3
Views: 602
Reputation: 4926
I have added all the dependencies regarding JPmml.
You have added all dependencies, but your application can't see them, because in your application classpath, there is an Apache Spark ML provided org.jpmml:pmml-model:1.2.X
(has method MiningField#setFieldUsage(MiningField$FieldUsage)
), which shadows your org.jpmml:pmml-model:1.3.X
(has method MiningField#setUsageType(MiningField$UsageType)
): https://issues.apache.org/jira/browse/SPARK-15526
You should stop reinventing the wheel, and use the JPMML-SparkML-Package library. This application classpath/packaging issue is specifically covered in its documentation.
Upvotes: 1