ERROR PMML Predictor

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?

Elena

1 Like

@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.

1 Like

I still get the same error message :confused:

MicrosoftTeams-image (13)

Upps wrong screenshot…

Hi @ElenaSW

Take a look at the Integrated Deployment nodes / flows and concept. With integrated deployment you don’t need PMML files anymore.
gr. Hans

1 Like

@ElenaSW not all aggregation methods are available for all methods with PMML. Maybe try a different one.

https://dmg.org/pmml/v4-4/MultipleModels.html

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.
1 Like

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:

2 Likes

Hi @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 “object to Table” conversion is available from here below:

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.

Best
Ael

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.