A colleague shows you a training script where the loss function is defined as Mean Squared Error (MSE) between the model's predictions and the target values. Based on this loss choice alone, what kind of task is the model most likely being trained for?
Select an answer to reveal the explanation.
Short Explanation and Infographic
MSE is your classic regression loss — here's why. It squares the difference between the predicted number and the actual number, then averages that across all your examples. That only makes sense when the target is a continuous quantity, like a price or a temperature, where 'close but not exact' still means something. Classification tasks want cross-entropy instead, because you're comparing predicted probabilities against a class label, not two real numbers. Clustering doesn't even use a target label at all — there's nothing to compute an error against. So when you see MSE, think regression, full stop.
Full explanation below image
Full Explanation
Mean Squared Error is defined as the average of the squared differences between predicted values and true target values: MSE = (1/n) * sum((y_pred − y_true)^2). This loss function is designed for continuous-valued targets, which is the defining characteristic of a regression task — for example, predicting house prices, temperatures, or sensor readings. Squaring the error penalizes larger deviations more heavily and keeps the loss differentiable and smooth, which works well when the output is a real number. Multi-class classification with mutually exclusive labels is incorrect because that setting typically pairs a softmax output layer with a categorical cross-entropy (or negative log-likelihood) loss, which measures the divergence between a predicted probability distribution and a one-hot true label — squaring raw class indices or one-hot vectors with MSE does not properly capture probabilistic classification error and produces poor gradients for that setting. Binary classification with a probability output is also incorrect for the same underlying reason: binary classification is standardly paired with binary cross-entropy (log loss), which is derived from the Bernoulli likelihood and provides well-behaved gradients near 0 and 1; using MSE against a sigmoid output is possible but is a known suboptimal choice and not what MSE is 'most likely' indicating on an exam-level question. Clustering of unlabeled data points is incorrect because clustering (e.g., k-means, Gaussian mixture models) is an unsupervised task with no ground-truth target label to compare a prediction against in the first place — there's nothing for MSE to be computed against, since MSE inherently requires paired (prediction, true value) data. The reliable memory aid: loss function often signals task type — MSE and MAE (Mean Absolute Error) point to regression, while cross-entropy variants point to classification, and clustering objectives (like inertia or log-likelihood in EM) don't involve labeled targets at all.