Component with not all inputs connected / switch case flow

Hi,

I’m searching for an alternative for the following problem:

Currently, I wanted to create Shapley values in a component with a selectable model type (H2O / XGBoost /Gradient Boosting).
Depending on that configuration, the values would have only been calculated for that model.
The other inputs should be ignored.
Sadly, the node won’t execute without every input connected.
But that would be the reason for the ‘selection’ in the first place.

Can you think of a workaround?

Component 1


What you want is optional input ports. I know that some nodes have them. I also found fossilised forum threads asking on how to code a node with opt. ports.
The only really relevant thread is this one, but unfortunately it seems that this is currently (2020) not possible at all:

I can’t think of a way to work around that. But it definitely is an attractive feature request!

2 Likes

Thank you @Thyme for your effort in helping me :slight_smile:
I’ve found (not a good, but a possible) workaround myself.
I created another node with just a few dummy data and all different kinds of model learners.
The model types from my actual node, which the users don’t want to use, can be connected to this dummy node.
I’ve found that it doesn’t create an issue if the data is totally different:

workaround 1

But @knime, that would really be an excellent improvement, if you could make inputs optional (at least the connection outside of the components).