Linear Regression with many columns

Hello all,

is it possible to calculate the slope of several columns? I tried it with the Linear Regression Learner and with one column (and of course one “independent” column) it works.
linearR_1column
Coeff. = slope independent/solar

Is it also possible with multiple columns that always refer to the same “independent” column?
linearR_table

Is it possible to include a loop here if necessary?

Linear_Regression_mult_column.knwf (13.4 KB)

Many greetings
Bernd

You want to keep the same independent column and loop over the target column? This can be done with a Column List Loop Start:
The independent column is exposed every thyme, the target columns is different every iteration. The Regression Learner is “remote controlled” with a Flow Variable to dynamically change the target column. This can be done in the “Flow Variables” Tab in the settings (every node can do that, it’s quite powerful).
Afterwards the name of the target column is appended (again via Flow Variables), followed by a normal loop end.


Linear_Regression_mult_column.knwf (42.1 KB)

4 Likes

Thanks a lot, thats it!
Many greetings, Bernd

1 Like

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