jpmml / jpmml-sparkml

Java library and command-line application for converting Apache Spark ML pipelines to PMML
GNU Affero General Public License v3.0
267 stars 80 forks source link

Add support for `FPGrowth` model type #50

Closed gvasmatkar closed 3 years ago

gvasmatkar commented 6 years ago

Getting the following exception -

java.lang.IllegalArgumentException: Transformer class org.apache.spark.ml.fpm.FPGrowthModel is not supported

I am trying to convert an FPGrowth model into PMML. Is it not supported?

vruusmann commented 6 years ago

java.lang.IllegalArgumentException: Transformer class org.apache.spark.ml.fpm.FPGrowthModel is not supported

Sorry, the exception message is a bit misleading because it refers to FPGrowthModel as "transformer" and not as an "estimator" or "model". But otherwise it's to be taken literally.

Haven't noticed the FPGrowth estimator type before, but it looks to be available starting from Apache Spark 2.2 (ie. can be introduced to JPMML-SparkML version 1.3.X and newer): https://spark.apache.org/docs/2.2.0/api/java/org/apache/spark/ml/fpm/FPGrowth.html

It should be possible to map it to the AssociationModel element: http://dmg.org/pmml/v4-3/AssociationRules.html