Performance Metrics
Performance metrics are evaluation measures used to determine how well a machine learning model performs on a given dataset. They help in comparing models and selecting the best one.
✅ 1. Classification Performance Metrics
1. Accuracy
Measures the overall correctness of the model.
Accuracy=TP+TNTP+TN+FP+FNAccuracy = \frac{TP + TN}{TP + TN + FP + FN}
2. Precision
Measures how many predicted positives are actually positive.
Precision=TPTP+FPPrecision = \frac{TP}{TP + FP}
3. Recall (Sensitivity / True Positive Rate)
Measures how many actual positives are correctly predicted.
Recall=TPTP+FNRecall = \frac{TP}{TP + FN}
4. F1-Score
Harmonic mean of Precision and Recall.
F1=2×Precision×RecallPrecision+RecallF1 = 2 \times \frac{Precision \times Recall}{Precision + Recall}
5. Specificity (True Negative Rate)
Measures how many actual negatives are correctly predicted.
Specificity=TNTN+FPSpecificity = \frac{TN}{TN + FP}
6. Confusion Matrix
A table that summarizes classification performance:
| Actual / Predicted | Positive | Negative |
|---|---|---|
| Positive | TP | FN |
| Negative | FP | TN |
✅ 2. Regression Performance Metrics
1. Mean Absolute Error (MAE)
MAE=1n∑∣y−y^∣MAE = \frac{1}{n}\sum |y – \hat{y}|
2. Mean Squared Error (MSE)
MSE=1n∑(y−y^)2MSE = \frac{1}{n}\sum (y – \hat{y})^2
3. Root Mean Squared Error (RMSE)
RMSE=MSERMSE = \sqrt{MSE}
4. R-Squared (Coefficient of Determination)
R2=1−SSresSStotR^2 = 1 – \frac{SS_{res}}{SS_{tot}}
✅ 3. Clustering Performance Metrics
1. Silhouette Score
Measures how well points fit into their cluster.
- Range: -1 to +1
- Higher value = better clustering
2. Davies-Bouldin Index
Lower value indicates better clustering.
3. Calinski-Harabasz Index
Higher value indicates better cluster separation.
