Open zhangjunqiang opened 6 years ago
Is it necessary that must have a ModelConverter in my pipelinemodel?
Yes, this requirement is clearly communicated by the exception message.
If you want to export pipelines that are feature transformation-dominant, then you should consider introducing a dummy (ie. no-op) model into the pipeline. For example, in Scikit-Learn you can use estimator types DummyRegressor
and DummyClassifier
for that purpose.
The model object is needed to define the "schema" of the pipeline - what are the input features, what are the output features. Without the model object the converter can only generate empty PMML documents.
Thank you for your reply,does have any dummy model in the spark mllib? I use spark ml in my train.
does have any dummy model in the spark mllib?
Depending on your Apache Spark ML version, there may or may not be appropriate technical workarounds available.
For example, a potential solution:
Pipeline
and fit it.PipelineModel
and "manually" append an appropriate org.apache.spark.ml.PredictionModel
object instance to it. Please note that you would be dealing with a PredictorModel
subclass here (representing a model that has been fitted), not with a Predictor
subclass (representing a model that is yet to be fitted).Someone might search the Apache Spark JIRA, and see if there is a feature request for dummy estimator classes already available or not.
I wouldn't want to create and maintain these classes myself. But if absolutely necessary, I will do it.
Reopening, because I might want to provide some sort of easier workaround in the JPMML-SparkML library.
@vruusmann So nice you are!
Hello: When I use Converter like this
val oneHotPMML = ConverterUtil.toPMML(onehotSource.schema, oneHotModel)
, I got a Error like this:After debug, I got the reason. There didn't have any ModelConverter in my model. Is it necessary that must have a ModelConverter in my pipelinemodel?