Starting a GLM using H2O GLM Learner (Regression)

Hello all!

I want to start a generalized linear model in KNIME. Therefore, I am using H2O extension nodes. My current worklfow looks like:
CSV-Reader – Number to String – Table to H2O (plus H2O Local Context as incoming node) – H2O GLM Learner (Regression). When I want to execute (or even open it) the Regression node following error message occurs:

image

The ‘normal’ H2O GLM Learner node works on this workflow, but this is not what I want to have.
I hope, you can understand my issue and would be very glad to get it working. Thank you in advance!

If you use a regression learner the Target variable would have to be a numeric variable. And that is what the error message is telling you.

3 Likes

Hello @mlauber71!

Thank you very much for your response and solution. It works!

1 Like

Hello again,

another question: What can I do to change my columns UW_15 and MW_15 from ‘S’ into ‘I’ columns?

image
It is because in the GLM Learner (Regression) Node column UW_15 (and later on MW_15) shall become my target column. But right now, I only can choose columns of type ‘I’ as the target column of my analysis. Any hints? :slight_smile:

You might have to remove the “%” and then think what to do with the double values. Either take them als double or multiply them with 100 to not loose any information.

2 Likes

Hello @mlauber71!
Thanks for your response. But I do not really understand what you exactly mean (I am sorry :see_no_evil:) . To get rid of the “%” I converted these numbers in my excel table from percetage to number (5,351% --> 0,05351). I also multiplied these numbers than with the factor of 100. Unfortunately, the columns UW and MW are still marked as ‘S’ columns and I cannot select them in the GLM regression node.

The String to number node should be able to help you

2 Likes

Using the String to Number node, it creates only missing values: image
image

You could have a look at this example:

kn_forum_pct_string.knwf (28.7 KB)

2 Likes

Thank you!
Now it works. But I have around 10 different columns having the ‘%’ sign. Do I have to set up a String Manipulation for each column or is there a way to have it all at once? :slight_smile:

This should be possible with column expressions:

KNIME Column Expression

1 Like

Thank you very much for all your replies. I’ll give the ‘Column Expressions’ Node a try!

1 Like

Hello @mlauber71!

I just want to let you know that everything works now. Thank you! :slight_smile:

2 Likes

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