onnx / onnxmltools

ONNXMLTools enables conversion of models to ONNX
https://onnx.ai
Apache License 2.0
969 stars 178 forks source link

Seems no Support for pyspark ALS #319

Open ac4922 opened 5 years ago

ac4922 commented 5 years ago

I am trying to convert a ASL model to ONNX. But it seems there is no support for it . Could you please check this?

Code:

from pyspark.ml.recommendation import ALS model = ALS(userCol='userid',itemCol='catid',ratingCol='rating', coldStartStrategy="drop") pipeline = Pipeline(stages=[model]) initial_type = [ ("numfeat1", FloatTensorType([1, 1]))

]

model_onnx = convert_sparkml(pipeline, 'Sparkml Test Pipeline', buildInitialTypesSimple(test_data))

ERROR:

/opt/conda/lib/python3.7/site-packages/onnxmltools/convert/sparkml/ops_names.py in get_sparkml_operator_name(model_type) 88 ''' 89 if model_type not in sparkml_operator_name_map: ---> 90 raise ValueError("No proper operator name found for '%s'" % model_type) 91 return sparkml_operator_name_map[model_type] 92

ValueError: No proper operator name found for '<class 'pyspark.ml.pipeline.Pipeline'>'

vinitra-zz commented 5 years ago

Hello @ac4922. Unfortunately we don't have the resources currently to add the Alternating Least Squares PySpark operator. We welcome community contributions!