Create New Binary Variable From String Variable

I have a data set with a String column with a fixed set of entries.

For the sake of example, suppose the values in this Column are:
yellow, blue, green, orange, red, purple, black, white

I want to create a new variable (appended to the dataset) that is derived from this variable that is essentially:
= 1 if String Column in (yellow, blue, red)
= 0 otherwise

I intend to use this new variable as a response variable in a binary model.

I’m unsure of how to do this in KNIME. Any help would be appreciated.
Thank you.

The Rule Engine node will do what you want. See for details and examples.


1 Like

Perfect - thank you.

1 Like

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