Python Script Node KNIME - PLS/PLS-DA algorithm

Hi everyone,
hope everything is going well.

I’m working with a Python Script where I would like to have different output variables, in one node.


  • I’m applying a PLS-DA algorithm in Python code (for what is my understanding so far, there is no KNIME node for that, only for the PCA, am I right?);
  • I need different outputs and I would like to have them from just one Python Script node. For instance, using the PCA node from KNIME (I’m talking about the PCA Compute node), I can have three different outputs (Covariance matrix, Spectral decomposition, Transformation model).
    My goal is to have something similar (with the specific results for the PLS-DA, of course) but from a single Python Script node. Until now I was able to use just the output_table_1 as a output variable.

Do you have any idea how can I achieve this?


Just as a side question, anyone knows why the PLS/PLS-DA algorithm is not implemented in KNIME itself?
I’ve found this already implemented node (PLS Model Building – KNIME Hub), but you need the Schrödinger Extension for KNIME.
Wouldn’t be nice to have it also in KNIME in the same way as we have it for the PCA?
Maybe with the possibility to choose between a single dependent variable Y and also multiple ones?

Thank you very much for your time!


Hello @alessandro_mac,

Regarding your first question. In order to have multiple inputs and outputs for Python Script node you can use a button that controls dynamic ports - it is three dots in the left lower corner of the node:

In the code you can refer to input_table_X or output_table_X, where X is the number of the port, starting with 1.

Regarding you second question. As far as I know there is no implementation of PLS-DA in Knime unfortunately. However I agree with you it would be nice to have.

By any chance if you succeed in building you PLS-DA implementation with Python could you please share it?


Hi @Artem,

Thank you very much for your quick reply!

Great, thanks, I missed that simple detail!

I’ve also checked the Schrödinger implementation again, but unless you download also the software, I think it shouldn’t work. I receive a license error (as also shown here: PLS, OPLS, PLS-DA, ...)

As a reference:

Where they say:

The extensions will not work without a Schrödinger software installation.
And I’m not sure it would work on a web based app.

About the implementation, very gladly!
As soon as I have a working example I’ll share it here!

Thanks very much again!

1 Like

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