# Can someone explain the solution to the following problem?

Q) We want to learn a function f(x) of the form f(x) = ax + b which is parameterized by (a, b). Using squared error as the loss function, which of the following parameters would you use to model this function to get a solution with the minimum loss. (a) (4, 3) (b) (1, 4) (c) (4, 1) (d) (3, 4)

• it seems strange that this is the question. Since as it stands (without providing input-output data) there is no way to answer Jul 28, 2021 at 19:08

The function f(x) = ax + b is used to model some data. (a, b) are the parameters in the equation, which means they are the values that need to be optimized. We cannot optimize the values of x or f(x) because those are just inputs and outputs. Squared error is a loss function, modeled by

As a brief explanation of MSE, it's basically just the average of the square differences between the actual results in the data and the predicted results by your model.

In order to optimize (a, b), we need to find values for a and b such that the MSE is minimized over whatever data the model is trained on. Since you're given multiple choices, just try out each one and pick the one that returns the smallest MSE.

That said, doing all this requires the data, so although I gave you the way to the solution, you'll have to execute it yourself.

• Very good answer, Hats off. Jul 28, 2021 at 19:08
• Thank you. That was helpful. Aug 1, 2021 at 14:16

The calculated value for the above is given below.

One sample example. Consider the following 4 training examples

• x = −1, y = 0.0319 • x = 0, y = 0.8692 • x = 1, y = 1.9566 • x = 2, y = 3.0343

We want to learn a function f (x) = ax + b which is parametrized by (a, b). Using squared error as the loss function, which of the following parameters would you use to model this function. (1, 1) (1, 2) (2, 1) (2, 2)