A confusion matrix (Kohavi and Provost, 1998) contains information about actual and predicted classifications done by a classification system. Performance of such systems is commonly evaluated using the data in the matrix. The following table shows the confusion matrix for a two class classifier.
The entries in the confusion matrix have the following meaning in the context of our study:
- a is the number of correct predictions that an instance is negative,
- b is the number of incorrect predictions that an instance is positive,
- c is the number of incorrect of predictions that an instance negative, and
- d is the number of correct predictions that an instance is positive.
Predicted | |||
Negative | Positive | ||
Actual | Negative | a | b |
Positive | c | d |
Several standard terms have been defined for the 2 class matrix:
- The accuracy (AC) is the proportion of the total number of predictions that were correct. It is determined using the equation:
[1]
- The recall or true positive rate (TP) is the proportion of positive cases that were correctly identified, as calculated using the equation:
[2]
- The false positive rate (FP) is the proportion of negatives cases that were incorrectly classified as positive, as calculated usingthe equation:
[3]
- The true negative rate (TN) is defined as the proportion of negatives cases that were classified correctly, as calculated using the equation:
[4]
- The false negative rate (FN) is the proportion of positives cases that were incorrectly classified as negative, as calculated using the equation:
[5]
- Finally, precision (P) is the proportion of the predicted positive cases that were correct, as calculated using the equation:
[6]
The accuracy determined using equation 1 may not be an adequate performance measure when the number of negative cases is much greater than the number of positive cases (Kubat et al., 1998). Suppose there are 1000 cases, 995 of which are negative cases and 5 of which are positive cases. If the system classifies them all as negative, the accuracy would be 99.5%, even though the classifier missed all positive cases. Other performance measures account for this by including TP in a product: for example, geometric mean (g-mean) (Kubat et al., 1998), as defined in equations 7 and 8, and F-Measure (Lewis and Gale, 1994), as defined in equation 9.
[7]
[8]
[9]
In equation 9, b has a value from 0 to infinity and is used to control the weight assigned to TP and P. Any classifier evaluated using equations 7, 8 or 9 will have a measure value of 0, if all positive cases are classified incorrectly.
相关推荐
Matlab code for computing and visualization: Confusion Matrix, Precision/Recall, ROC, Accuracy, F-Measure etc. for Classification. Matlab通过分类的label计算混淆矩阵Confusion Matrix并且显示的函数只要...
Confusion Matrix in Python plot a pretty confusion matrix (like Matlab) in python using seaborn and matplotlib.zip
matlab开发-ConfusionMatrix。计算多类问题的混淆矩阵
混淆矩阵、准确率、召回率、精准率、ROC曲线计算和可视化
常用的matlab机器学习中的confusion matrix的计算和绘制。 输入为预测标签和真实标签。可用于二分类,多分类等任务中。 不需要matlab额外的toolbox,即插即用,方便快捷,代码注释详细, 一读就懂,就会使用。
混淆矩阵(Confusion Matrix)是在监督学习中用于评估分类算法性能的一种常见工具。它是一个 N×N 的矩阵(其中 N 是类别的数量),其中矩阵的行代表真实的类别,列代表预测的类别。每个元素 (i, j) 表示真实类别为 ...
confusion matrix使用MATLAB绘制多分类的混淆矩阵图,可自定义横纵坐标、字体、渐变颜色等,适用于深度学习、机器学习中多分类任务的结果分析混淆矩阵图。
matrix_confusion whit k_fold
混淆矩阵的python代码。 包括了查准率,召回率的计算 model是resnet34,数据数CIFAR10
可以用matlab来画混淆矩阵,很好用,还可以直观的显示分类的效果
confusion_matrix.m_混淆矩阵生成_混淆矩阵_源码
分类准确度衡量之混淆矩阵
:hammer_and_wrench: 如何安装运行以下命令: npm install confusion-matrix-stats :woman::laptop: 如何使用它您只需要创建一个新的Confusion Matrix实例: const confusionMatrix = new ConfusionMatrix ( { ...
ConfusionMatrix类可用于为对象检测任务生成混淆矩阵。 用法 在测试代码中,您需要使用适当的参数声明ConfusionMatrix类。 conf_mat = ConfusionMatrix(num_classes = 3, CONF_THRESHOLD = 0.3, IOU_THRESHOLD...
官方例子,深度学习专用,机器学习专用,代码简单,一看就会(dlcv make confusion matrix demo)
绘制混淆矩阵函数
cf_matrix.py 该文件包含一个名为 make_confusion_matrix 的函数,该函数可用于创建作为二维 numpy 数组传入的混淆矩阵的有用可视化。文档字符串 This function will make a pretty plot of an sklearn Confusion ...
about confusion matrix
ConfusionMatrix框图开放式集线器 PyPI计数器 Github星 科主开发者特拉维斯 AppVeyor 代码质量安装 :warning_selector: PyCM 2.4是支持Python 2.7和Python 3.4的最新版本 :warning_selector: 绘图功能需要...
This function implements cepstral mean and variance normalization (CMVN) on input feature matrix fea to remove the (locally) linear channel effects. The code assumes that there is one observation per ...