Predictive clustering in R Knime

Hi everybody, I am trying to make a predictive clustering workflow using the R nodes in knime in which three aproaches were used and none of them were successful: 

In the first one, I used the R learned node but, the kmeans (as expected) is not recognized as a predictive model.

In the second one, I used the clue package and the cl_predict function in the R Snippet (2:1) node but I keeps executing. 

In the third one, I was writing a R model and the reading that model, but again I got busted. 

The main assumption is that I want to train a cluster model with some data and then apply new data to such model, I do not know if that is called predictive clustering. 

I want to use R because I do not know any knime node that helps me to evaluate a cluster using the Dunn index, Silhouette, elbow method, etc. 

The workflow is attached

 

 

Hi mau,

I would say that you were on the right track with your first approach. I replaced the base R predict with cl_predict and it works, like this:

library(clue)
mytable<-as.matrix(knime.in[1:4])
knime.out <- cbind(mytable, cl_predict(knime.model, mytable))

That should do the trick!

 

Cheers,

Roland

Thank you it worked fine