measuring model performance or error
play

Measuring model performance or error Introduction to Machine - PowerPoint PPT Presentation

INTRODUCTION TO MACHINE LEARNING Measuring model performance or error Introduction to Machine Learning Is our model any good? Context of task Accuracy Computation time Interpretability 3 types of tasks


  1. INTRODUCTION TO MACHINE LEARNING Measuring model performance or error

  2. Introduction to Machine Learning Is our model any good? ● Context of task ● Accuracy ● Computation time ● Interpretability ● 3 types of tasks ● Classification ● Regression ● Clustering

  3. Introduction to Machine Learning Classification ● Accuracy and Error ● System is right or wrong ● Accuracy goes up when Error goes down correctly classified instances Accuracy = total amount of classified instances Error = 1 - Accuracy

  4. Introduction to Machine Learning Example ● Squares with 2 features: small/big and solid/do � ed ● Label: colored/not colored ● Binary classification problem

  5. Introduction to Machine Learning Example Truth Predicted ✔ ✘ ✘ ✔ ✔ ✔ ✔ ✔ 3 = = 60% 5 ✔ ✔ ✔ ✘ ✘

  6. Introduction to Machine Learning Example Truth Predicted ✔ ✘ ✘ ✔ ✔ ✔ ✔ ✔ 3 = = 60% 5 ✔ ✔ ✔ ✘ ✘

  7. Introduction to Machine Learning Limits of accuracy ● Classifying very rare heart disease ● Classify all as negative (not sick) ● Predict 99 correct (not sick) and miss 1 ● Accuracy: 99% ● Bogus… you miss every positive case!

  8. Introduction to Machine Learning Confusion matrix ● Rows and columns contain all available labels ● Each cell contains frequency of instances that are classified in a certain way

  9. Introduction to Machine Learning Confusion matrix ● Binary classifier: positive or negative (1 or 0) Prediction P N p TP FN Truth n FP TN

  10. Introduction to Machine Learning Confusion matrix ● Binary classifier: positive or negative (1 or 0) Prediction True Positives P N Prediction: P Truth: P p TP FN Truth n FP TN

  11. Introduction to Machine Learning Confusion matrix ● Binary classifier: positive or negative (1 or 0) Prediction True Negatives P N Prediction: N Truth: N p TP FN Truth n FP TN

  12. Introduction to Machine Learning Confusion matrix ● Binary classifier: positive or negative (1 or 0) Prediction False Negatives P N Prediction: N Truth: P p TP FN Truth n FP TN

  13. Introduction to Machine Learning Confusion matrix ● Binary classifier: positive or negative (1 or 0) Prediction False Positives P N Prediction: P Truth: N p TP FN Truth n FP TN

  14. Introduction to Machine Learning Ratios in the confusion matrix ● Accuracy ● Precision ● Recall Prediction P N p TP FN Truth n FP TN

  15. Introduction to Machine Learning Ratios in the confusion matrix ● Accuracy ● Precision ● Recall Prediction Precision P N TP/(TP+FP) p TP FN Truth n FP TN

  16. Introduction to Machine Learning Ratios in the confusion matrix ● Accuracy ● Precision ● Recall Prediction Precision P N TP/(TP+FP) p TP FN Truth n FP TN

  17. Introduction to Machine Learning Ratios in the confusion matrix ● Accuracy ● Precision ● Recall Prediction Recall P N TP/(TP+FN) p TP FN Truth n FP TN

  18. Introduction to Machine Learning Ratios in the confusion matrix ● Accuracy ● Precision ● Recall Prediction Recall P N TP/(TP+FN) p TP FN Truth n FP TN

  19. Introduction to Machine Learning Back to the squares Prediction P N Truth p 1 1 Truth Predicted n 1 2

  20. Introduction to Machine Learning Back to the squares Prediction P N Truth p 1 1 Truth Predicted n 1 2 ✔

  21. Introduction to Machine Learning Back to the squares Prediction P N Truth p 1 1 Truth Predicted n 1 2 ✔ ✔

  22. Introduction to Machine Learning Back to the squares Prediction P N Truth p 1 1 Truth Predicted n 1 2 ✘

  23. Introduction to Machine Learning Back to the squares Prediction P N Truth p 1 1 Truth Predicted n 1 2 ✘

  24. Introduction to Machine Learning Back to the squares ● Accuracy: (TP+TN)/(TP+FP+FN+TN) = (1+2)/(1+2+1+1) = 60% ● Precision: TP/(TP+FP) = 1/(1+1) = 50% ● Recall: TP/(TP+FN) = 1/(1+1) = 50% Prediction P N Truth p 1 1 Truth Predicted n 1 2 ✔ ✔ ✔

  25. Introduction to Machine Learning Back to the squares ● Accuracy: (TP+TN)/(TP+FP+FN+TN) = (1+2)/(1+2+1+1) = 60% ● Precision: TP/(TP+FP) = 1/(1+1) = 50% ● Recall: TP/(TP+FN) = 1/(1+1) = 50% Prediction P N Truth p 1 1 Truth Predicted n 1 2 ✔ ✘ ✘ ✔ ✔

  26. Introduction to Machine Learning Back to the squares ● Accuracy: (TP+TN)/(TP+FP+FN+TN) = (1+2)/(1+2+1+1) = 60% ● Precision: TP/(TP+FP) = 1/(1+1) = 50% ● Recall: TP/(TP+FN) = 1/(1+1) = 50% Prediction P N Truth p 1 1 Truth Predicted n 1 2 ✘ ✔

  27. Introduction to Machine Learning Back to the squares ● Accuracy: (TP+TN)/(TP+FP+FN+TN) = (1+2)/(1+2+1+1) = 60% ● Precision: TP/(TP+FP) = 1/(1+1) = 50% ● Recall: TP/(TP+FN) = 1/(1+1) = 50% Prediction P N Truth p 1 1 Truth Predicted n 1 2 ✘ ✔

  28. Introduction to Machine Learning Rare heart disease ● Accuracy: 99/(99+1) = 99% ● Recall: 0/1 = 0% ● Precision: undefined — no positive predictions Prediction P N p 0 1 Truth n 0 99

  29. Introduction to Machine Learning Regression: RMSE ● Root Mean Squared Error (RMSE) ● Mean distance between estimates and regression line ● 12 ● ● ● ● ● ● ● 11 ● ● ● ● ● ● ● ● ● 10 ● ● X2 ● ● ● 9 ● ● ● ● ● ● 8 ● ● ● ● ● ● ● ● ● 7 ● ● ● 6 6 7 8 9 10 11 12 X1

  30. Introduction to Machine Learning Clustering ● No label information ● Need distance metric between points

  31. Introduction to Machine Learning Clustering ● Performance measure consists of 2 elements ● Similarity within each cluster ● Similarity between clusters 


  32. Introduction to Machine Learning Within cluster similarity ● Within sum of squares (WSS) ● Diameter 10 ● ● ● ● Minimize ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 5 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● X2 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● − 5 − 5 0 5 10 X1

  33. Introduction to Machine Learning Between cluster similarity ● Between cluster sum of squares (BSS) ● Intercluster distance 10 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 5 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● Maximize ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● X2 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● − 5 − 5 0 5 10 X1

Recommend


More recommend