You are on page 1of 9

Machine Learning

B.Tech (CSBS) Vth Semester

By:
Prof. Moumita Pal
B.Tech (CSE), M.Tech (CI), Ph.D (pursuing)
Contact No.: +919952038867
Mail id: moumitafdp@gmail.com
Contents: Unit 2 Lecture 2&3

 Model Evaluation
 Precision
 Recall
 F1-measure
 Accuracy
 Area under curve

Prof. Moumita Pal 2


Model Evaluation

 Train/Test is a method to measure the accuracy of your model.


 It is called Train/Test because you split the data set into two sets: a
training set and a testing set.
 Example: 80% for training, and 20% for testing.
 You train the model using the training set.
 You test the model using the testing set.
 Train the model means create the model.
 Test the model means test the accuracy of the model.

Prof. Moumita Pal


Confusion Matrix
• The confusion matrix is also known as Error matrix and is represented by a table which
describes the performance of a classification model on a set of test data in machine
learning.

• In the above table, Class 1 is depicted as the positive table and Class 2 is depicted as the
negative table.

• It is a two-dimensional matrix where each row represents the instances in predictive class
while each column represents the instances in the actual class or you put the values in the
other way.

• Here, TP (True Positive) means the observation is positive and is predicted as positive, FP
(False Positive) means observation is positive but is predicted as negative, TN (True
Negative) means the observation is negative and is predicted as negative and FN (False
Negative) means the observation is negative but it is predicted as positive.

Prof. Moumita Pal 4


Precision & Recall

Prof. Moumita Pal 5


F1 Score

Prof. Moumita Pal 6


Accuracy

 When it comes to evaluating a Binary Classifier, Accuracy is a well-known performance metric


that is used to tell a strong classification model from one that is weak.
 Accuracy is, simply put, the total proportion of observations that have been correctly
predicted.
 There are four (4) main components that comprise the mathematical formula for calculating
Accuracy, viz. TP, TN, FP, FN, and these components grant us the ability to explore other ML
Model Evaluation Metrics.
 The formula for calculating accuracy is as follows:

Prof. Moumita Pal 7


AUC-ROC
• ROC or Receiver Operating Characteristics Curve is one of the most popular evaluation
metrics for checking the performance of a classification model.

• The curve plots two parameters, True Positive Rate (TPR) and False Positive Rate (FPR).

• Area Under ROC curve is basically used as a measure of the quality of a classification
model. Hence, the AUC-ROC curve is the performance measurement for the classification
problem at various threshold settings.

• The True Positive Rate or Recall is defined as

• The False Positive Rate is defined as

Prof. Moumita Pal 8


Any Questions?

Prof. Moumita Pal 9

You might also like