0
$\begingroup$

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)

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

2 Answers 2

3
$\begingroup$

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 enter image description here

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.

$\endgroup$
2
  • $\begingroup$ Very good answer, Hats off. $\endgroup$
    – Ubikuity
    Jul 28, 2021 at 19:08
  • $\begingroup$ Thank you. That was helpful. $\endgroup$ Aug 1, 2021 at 14:16
0
$\begingroup$

enter image description here

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)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.