Google News
logo
Data Science - Interview Questions
What is the Confusion Matrix?
A confusion matrix is a 2X2 table that consists of four outputs provided by the binary classifier.
 
A binary classifier predicts all data instances of a test dataset as either positive or negative. This produces four outcomes-
 
True positive(TP) : Correct positive prediction
False-positive(FP) : Incorrect positive prediction
True negative(TN) : Correct negative prediction
False-negative(FN) : Incorrect negative prediction

It helps in calculating various measures including error rate (FP+FN)/(P+N), specificity(TN/N), accuracy(TP+TN)/(P+N), sensitivity (TP/P), and precision( TP/(TP+FP) ).
 
A confusion matrix is essentially used to evaluate the performance of a machine learning model when the truth values of the experiments are already known and the target class has more than two categories of data. It helps in visualisation and evaluation of the results of the statistical process.
Advertisement