Classification
When training a model, our aim is to train the algorithm such that it can distinguish between two entities.
For example tomatoes and apples. Based on a decision boundary it can classify apples and tomatoes separately when shown a new picture that it hasn't seen before based on experiential data.
this is a very simple decision boundary but often its not already so independent
this is a more realistic decision boundary where the two entities are more similar and difficult to distinguish
Confusion Matrix
it is used to represent the results of classification. It is a table that summarises the performance of the classification model.
confusion matrix
TP - True positive: answer is true and the model also predicts true correctly.
FP - False positive: answer is false but the model predicts false.
FN - False negative: answer is false but the model predicts true. (showing something that should not be there)
TN - True negative: answer is false and the model also predicts false correctly.
Metrics
Accuracy: number of correct guesses out of all guess made.
Imagine you're picking apples from a tree. Accuracy is like counting all the apples you've picked correctly out of all the apples you've picked, regardless of whether they were good or bad. So, if you picked 90 apples correctly out of 100 apples you picked in total, your accuracy would be 90%.
Accuracy = (TP +TN) / (TP + TN + FP + FN)
Precision: tells us how many of the predicted true values are correct.
Precision is like how many of the apples you picked were actually good. If you picked 100 apples, and you said 90 of them were good, but only 85 of those 90 were actually good, then your precision would be 85%. It's about how many of the apples you said were good turned out to be good.
Precision = TP / ( TP + FP)
Recall: how many trues out of all the trues we got.
Recall is like how many of the good apples you managed to pick out of all the good apples on the tree. If there were 100 good apples on the tree, but you only managed to pick 85 of them, your recall would be 85%. It's about how many of the actual good apples you were able to find.
Recall = TP / ( TP + FN)
Harmonic mean of Precision and Recall: used over accuracy as a metrics to avoid using incorrect prediction model. it helps measure precision and recall at the same time. \
F1 score = (2*P*R)/(P+R)
Application of classification include: tumour - benign/ malignant, email - spam or not, other medical applications.
Comments
Post a Comment