Logistic Regression Categorical Variables

Hi there,

I haven’t seen anything about how Knime treats categorical variables in Logistic Regression. We have categorical variables such as Gender and Acorn. Will Knime automatically create dummy variables for these variables.

Thank you.

Hello @RNIB_ianhill,

No, the Logistic Regression Learner will not auto convert categorical data to dummy variables. However, doing this is relatively simple and can be done with the node shown below (ie. one hot encoding):

Edit:
Here is a video I found that explains how you can do so in KNIME, it is on the classic UI, but should still be helpful.

Hope this helps,
TL

3 Likes

As Thor mentioned, the One to Many node can do the trick, but you might want to be mindful that it doesn’t create N-1 columns. You can use the Column Filter node to drop one of the newly created columns in order to manually specify the reference category.

2 Likes