Middle — Senior
How to understand whether a model is good or bad? What metrics exist and what do they mean?
sobes.tech AI
Answer from AI
Model quality assessment depends on the task (classification, regression, etc.) and goals. Main metrics:
For classification tasks:
- Accuracy — the proportion of correct predictions out of the total. Suitable for balanced classes.
- Precision — the proportion of correctly predicted positive examples among all predicted positives.
- Recall — the proportion of correctly identified positive examples among all actual positives.
- F1-score — the harmonic mean of precision and recall, balancing between them.
- ROC-AUC — the area under the ROC curve, indicating the quality of class separation.
For regression tasks:
- MSE (Mean Squared Error) — mean squared error, sensitive to large deviations.
- MAE (Mean Absolute Error) — mean absolute error, more robust to outliers.
- R² (coefficient of determination) — shows the proportion of variance explained by the model.
A good model is one that shows high metric values (e.g., high accuracy and F1 for classification, low errors for regression) on a validation set (test), not just on the training set (to avoid overfitting). It is also important to consider the business context and balance between metrics (e.g., sometimes recall is more important than precision).