How to optimize the two variable's values in linear regression

Hi,
you have only executed the loop body once, so it is using the initial parameters. To let the loop iterate multiple times, you have to calculate some quality metric you want to use for the optimization. What metric do you expect to optimize, i.e. how do you want to determine which combination of A and B is best? You need to calculate that in your loop and then pass it as flow variable to the Parameter Optimization Loop End.
Kind regards
Alexander

1 Like

I want to optimize only A and B values for my model, bellow are the optimized values by using the Genetic Algorithm, I need my optimized values similar to these.

A
2.022817
B
0.897183

Hi,
but how did you decide that those values for A and B are best? What was the fitness function for the genetic algorithm?
Kind regards
Alexander

1 Like

Manhattan distance (MD) as the fitness function
md

Hi,
please see attached workflow for a solution.
Kind regards
Alexander
optimization.knwf (39.9 KB)

2 Likes

Thank you very much it’s now working fine :slight_smile: can you please explain why we are using the group by and loop end
why

Hi,
In the GroupBy we are calculating the mean over all differences between prediction and actual value. The loop end node collects those for each validation iteration. The next GroupBy node then averages over all validations.
Kind regards
Alexander

1 Like

Thank you for every thing.

Now we have the effort column (Class variable), how can I apply neural network on my dataset.
When i apply the MLP its giving me the error Domain range for regression in column ClassColumn not in range [0,1]

Hi,
The learner expects all columns to be between 0 and 1. You have to normalize the data before passing it to the learner.
Kind regards
Alexander

I already normalize the column with normalizer(PMML) its not working

Should I use a numeric scorer in the end?

Yes, for numeric predictions, i.e. regression, you have to use the numeric scorer.
Kind regards
Alexander

Thank you very much, it’s now working fine, I have the last question, please.
here is my SVM flow


I have the class variable(integer) when I converting the values in the string so I can pass this values to the SVM learner but at the end of the Scorer, it’s giving me the 0% Accuracy.

Hi, are you comparing the right columns in the Scorer? 0% accuracy is really strange, as even random guessing should give you around 50%.
Kind regards
Alexander

yes, i am giving the right column for scorer. can i convert the double values to string by number to string node as you can see in the screenshot…? am i using the right nodes in the workflow.?


This is the Learner setting.

Hi,
I think the problem must be in the Scorer. What if you manually compare the columns coming out of the predictor? Does it really look like they never match? Do they have the same type?
Kind regards
Alexander

Here is all the settings.
tuned1 tuned2 tuned3

Hi,
you are turning a double into a string to do classification, but that makes no sense. You want to do regression, right? The SVM cannot be used to predict numeric data and just turning your doubles into strings won’t work. You will just generate many, many classes, which the SVM cannot distinguish.
Kind regards
Alexander

1 Like

yes regression, and thank you thank you very much. can you please suggest the algorithm for regression problem…?