Evaluation
of the Matrix: Evaluation of the matrices provide a key role in the accuracy of the
model. There are different evaluation matrices but here going to discuss only
three i.e. Jaccard Index, F1 score Confusing Matrix, and Log loss.
1. Jaccard
Index: Let us consider that y is actual labels
and x is predicted labels. Then the Jaccard index is given by J(y,x)
J(y,x)
= ratio of intersection by the union of the actual label and predicted labels
For
example: y = [0,0,0,0,1,1,1,1] and X = [1,1,0,0,0,1,1,1]
J
(y,x) = 8 / 12 = 0.66
2.F1
Score Confusing Matrix: It is best for binary classification.
Before defining the F1 Score, Let’s define some terms which are used in the definition.
Positive
|
Negative
|
|
Positive
|
True Positive
|
False Positive
|
Negative
|
False Negative
|
True Negative
|
Precision: Ratio of true positive
to the sum of a true and false positive.
Recall: Ratio of true positive
to the sum of a true positive and false negative.
Now F1 Score is defined
2*((precision)*(recall)/(precision + recall))
3. Log-Loss:
It
defines the performance of the classifier where predicted output is a
probability value between 0 and 1.
Log-loss = (1/N) * Σ [
(y log x) + (1 – y) log (1 – x) ]
It measures how far is the value from the
actual value. The lower value of log-loss indicates better accuracy. Among all
three, the F1 score is better.
No comments:
Post a Comment
If you have any doubt, let me know