PLS example code


I would like to use the R Integration nodes to build a PLS model, but need an example code to get started. Is the an example of PLS modeling using the Interactive R Statistics Integration nodes (not using the deprecated nodes)?



Hi Evert,

To build an R PLS model in KNIME you can use the "R Learner" node with the following code inside:



Consider that this lines of code produce a R PLS model for the prediction of column named "response" using all the other columns present as input in knime node. You have to replace "response" with the name of the column you would like to model. Additionally with the command "summary(" you can see the R log pushing the "Eval script" button inside the node configuration.

Finally you can modify the "" code line to customize your model (e.g. use a different number of LVs respect the default one, scale the variables, etc.)

The "R Learner" node can then be connected to an "R Predictor" one in order to predict the modeled response.

I hope this help,