1
$\begingroup$

i've a doubt on this thing.

It may seem like the MSE (Mean Squared Error) is calculated twice, but in reality, it is used at two different stages during the training process:

Weight Calculation: The first time the MSE is used is to minimize the error function and find the optimal weights w1w1​ and w0w0​ for the model. This process involves solving an optimization problem, where the goal is to find the weights that minimize the MSE. In other words, we are trying to make the sum of the squared errors between the predicted values y^iy^​i​ and the actual values yiyi​ as small as possible.

Model Evaluation: Once the optimal weights are found, the MSE is recalculated using the obtained weights to assess how well the model fits the data. In this second step, the MSE is used as a performance metric to measure the error between the model’s predictions and the actual data points, using the optimized weights.

In summary, the MSE is first minimized to determine the best weights and then recalculated with those weights to evaluate the model’s final performance. This explains why it may seem like the MSE is "calculated twice."

Is that thing right? Do we really have a two time calculus of MSE ?

$\endgroup$
1
  • 2
    $\begingroup$ It is not totally clear what modelling paradigm you are talking about but, assuming you are using the train-validate-test method, you seem to be saying that you train the model so as to minimise the loss (here the mean square error) when using the training data, and then use this model to make predictions on the validation or test data and measure the loss (mean square error again) to measure the quality of the model in making predictions. Yes, that involves looking at the loss more than once (perhaps many times if you use cross-validation for hyperparameter tuning or model selection). $\endgroup$
    – Henry
    Commented Oct 4 at 1:25

1 Answer 1

1
$\begingroup$

This seems to allude to evaluation on out-of-sample data.

In the first calculation of the MSE, the goal is to use the training (in-sample) data to calculate parameters. This is how you wind up with a trained model.

Then you want to know how good the model is, penalizing (in some sense) potential overfitting to coincidences in the training data instead of fitting to the real trend, so you evaluate the trained model on brand new data (out-of-sample data).

$\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.