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

Explicitly reject Model constructor parameter #86

Closed vruusmann closed 4 years ago

vruusmann commented 4 years ago

Inspired by https://github.com/jpmml/pyspark2pmml/issues/27

Looks like the PMMLBuilder class should provide a dummy constructor like PMMLBuilder(StructType, Model) (in addition to the non-dummy PMML(StructType, PipelineModel)), which would simply throw an IllegalArgumentException with the following message - "Expected PipelineModel, got Model"

vruusmann commented 4 years ago

Probably needs another dummy constructor to handle the unfitted pipeline case as well ("Expected PipelineModel, got Pipeline"): https://github.com/jpmml/pyspark2pmml/issues/22#issuecomment-521214856