Hi KNIME community,
I trained a random forest model (for regression) and saved it via the following nodes:
Random Forest Learner (Regression) → Tree Ensemble Model Extract → Table to PMML Ensemble → PMML Writer
In a new workflow I loaded the model via the PMML Reader Node. Howerever, when I try to make predictions with the PMML Predictor node, I get the following error message:
ERROR PMML Predictor
Execute failed: The multiple model method ‘majorityVote’ is not suitable for regression
I also tried, after loading the model via the PMML Reader Node, to apply the following nodes to get an input model for the Random Forest Predictor Regression Node directly:
PMML Reader → PMML To Cell → Cell To Model
Cell To Model however, gives me the following error
The dialog cannot be opened. No column in spec compatible to ‘PortObjectValue’.
Can someone please help?
PMML Predictor node
@ElenaSW welcome to the KNIME forum. You might have to use the
Notice that the simple PMML Predictor node cannot deal with ensemble models. Here you need to use the PMML Ensemble Predictor node to implement the majority vote.
PMML, Ensembles and KNIME are three hot topics, each one worthwhile to be used. However, when combined together these three pieces offer an even more powerful approach to data analytics than each one alone. We would like to take the opportunity in...
I still get the same error message
Take a look at the
Integrated Deployment nodes / flows and concept. With integrated deployment you don’t need PMML files anymore.
@ElenaSW not all aggregation methods are available for all methods with PMML. Maybe try a different one.
The model combination methods listed above are applicable as follows:
For regression models only average, weightedAverage, median, weightedMedian, sum, weightedSum, modelChain, selectFirst, or selectAll are applicable. The first six methods are applied to the predicted values of all models for which the predicate evaluates to true.
So there is no way in KNIME to save a random forest model and re-use it?
@ElenaSW you might want to try and use the model writer (and reader):
Like I this example:
If you want to read more you might want to check the links provided above or this meta collection of examples and articles:
@ElenaSW and welcome to the KNIME forum community
Would the following solution work in your case ?
I took and modified the workflow below available at:
and its CSV data available at:
The modified workflow with reading and writing through an “
” conversion is available from here below: object to Table
07 Random Forest with write and read of RF model.knwf (2.5 MB)
I couldn’t upload the executed workflow with its uncompressed data because it is far beyond the forum allowed limit size. Instead, I compressed it and then the workflow handles itself the decompression.
The essential solution are the nodes highlighted within a yellow rectangle in the workflow snapshot above.
Hope it helps. Otherwise please reach out and we will try to help.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.