Tutorial 6 Evaluation Metrics For Machine Learning Models: Classification and Regression Models
Tutorial 6 Evaluation Metrics For Machine Learning Models: Classification and Regression Models
Tutorial 6 Evaluation Metrics For Machine Learning Models: Classification and Regression Models
• Accuracy:
The number of correct predictions/the number of all
predictions
• Accuracy=(TP+TN)/(TP+FP+FN+TN)
Sensitivity and Specificity
Actual value (class)
Predicted value (class) Positive (diabetes=1) Negative (diabetes=0)
Positive (diabetes=1) 25 15 40
Negative (diabetes=0) 15 55 60
30 70 100
• Sensitivity: is the true positive rate also called the recall. It is the number of instances
from the positive (first) class that actually predicted correctly.
• Specificity: is also called the true negative rate. It is the number of instances from the
negative class (second class) that were actually predicted correctly.
ROC curve (A receiver operating
characteristic curve)
• A receiver operating characteristic curve, or ROC curve,
• a graphical plot that illustrates the predictive ability of a binary
classification model.
• The ROC curve is created by plotting the true positive rate (TPR)
against the false positive rate (FPR) at various threshold settings.
• The TPR is also known as sensitivity, recall or probability of detection
in machine learning.
• The FPR is also known as the fall-out or probability of false alarm and
can be calculated as (1 − specificity).
• Sensitivity: is the true positive rate also called the recall. It is the number of instances from the positive
(first) class that actually predicted correctly.
• Specificity: is also called the true negative rate. It is the number of instances from the negative class (second
class) that were actually predicted correctly.
AUC=1 (ideal case)
The model is perfectly able to distinguish between positive
class and negative class.
AUC=0.7
√
𝑛
1
𝑅𝑀𝑆𝐸= ∑ ( 𝑇𝑟𝑢𝑒𝑉𝑎𝑙𝑢𝑒 𝑗 − 𝑀𝑜𝑑𝑒𝑙𝐸𝑠𝑡𝑖𝑚𝑎𝑡 𝑒 𝑗 )
2
𝑛 𝑗=1
2. MAE
Mean Absolute Error
MAE
• mean absolute error (MAE)
• MAE is the average of the absolute differences between prediction
and actual observation.
• Compared to RMSE, MAE is easier to interpret but less sensitive to
outliers:
=
3. R squared
3. R squared
• also called the coefficient of determination
• provides a goodness-of-fit measure for the predictions.
• This is a value between 0 and 1 for no-fit and perfect fit respectively.