Closed okoutb closed 6 years ago
What could the reason be?
Very difficult to say what's going on, because your sample code doesn't match the exception.
AttributeError: 'PMMLPipeline' object has no attribute '_to_java'
Where is class PMMLPipeline
defined? There is such a class in the sklearn2pmml
package, but you cannot use a Scikit-Learn wrapper class with Apache Spark.
PMMLBuilder(spark, trainingData1, pipeline)
The third argument must be of type org.apache.spark.ml.PipelineModel
. Therefore, replace pipeline
with pipelineModel
there.
The README file of this project provides a complete and correct example. Please run it first, in order to get a better understanding how things should be put together.
@vruusmann Sorry I did have a mistake in copying, please see my edit with the correct error
TypeError: 'JavaPackage' object is not callable
It typically means that Java class org.jpmml.sparkml.PMMLBuilder
is not available on your PySpark session's classpath.
However, I'm not sure if "typically" applies in the current case, because the state of your (current-) PySpark session is completely messed up (there are probably JPMML-SparkML and JPMML-SkLearn classes together).
Again, please do exactly as the PySpark2PMML package README file tells you to do (starting with a fresh PySpark session). For as long as you haven't got this basic exercise right, there is absolutely no point in trying to do anything else/more complex.
I trained a RandomForestRegressor and I want to export it to PMML but I have an error:
And the error is:
What could the reason be?