Table of Contents

Validation Metrics

Validation metrics are used to evaluate the performance of a model on a validation dataset. These metrics help assess how well a model generalizes to unseen data. Below are common validation metrics categorized by problem type.

1. Regression Problems

Measures the average absolute difference between predicted and actual values.

  Formula:  
  **MAE = (1/n) Σ |y_i - ẏ_i|**

Averages the squared differences between predicted and actual values.

  Formula:  
  **MSE = (1/n) Σ (y_i - ẏ_i)²**

The square root of MSE, with the same units as the target variable.

Measures the proportion of variance explained by the model.

  Formula:  
  **R² = 1 - (Σ(y_i - ẏ_i)² / Σ(y_i - ȳ)²)**

2. Classification Problems

Proportion of correct predictions.

  Formula:  
  **Accuracy = (Correct Predictions / Total Predictions)**

Measures the proportion of true positives among predicted positives.

  Formula:  
  **Precision = TP / (TP + FP)**

Measures the proportion of true positives identified.

  Formula:  
  **Recall = TP / (TP + FN)**

Harmonic mean of precision and recall.

  Formula:  
  **F1 = 2 × (Precision × Recall) / (Precision + Recall)**

Measures the trade-off between true positive and false positive rates at various thresholds.

Evaluates the accuracy of predicted probabilities.

3. Clustering Problems

Measures how similar an object is to its cluster compared to other clusters.

Evaluates similarity between true labels and clustering results.

Assesses compactness and separation of clusters.

Measures how tightly grouped the clusters are.

4. Time Series Problems

Expresses prediction error as a percentage.

  Formula:  
  **MAPE = (100/n) Σ |(y_i - ẏ_i) / y_i|**

Reduces bias for small values in MAPE.

Penalizes under- and over-predictions logarithmically.

5. Ranking Problems

Evaluates ranking quality based on the reciprocal of the rank of the first relevant result.

Considers the position of relevant results in a ranked list.

Measures precision for the top-k predictions.

6. Multi-Label Problems

Proportion of misclassified labels.

  Formula:  
  **Hamming Loss = (1/nL) ΣΣ I(y_ij ≠ ẏ_ij)**

Measures the percentage of samples where all labels are correctly predicted.

Aggregate metrics across labels (macro) or weight by support (micro).

Summary

The choice of validation metric depends on the problem type, dataset characteristics, and business goals.