官术网_书友最值得收藏!

Building the confusion matrix

Let's now think about a binary classification problem. We have a set of samples belonging to two classes: YES or NO. We can build a machine learning model that outputs a class for each input set of variables. By testing our model on 200 samples, we will get the following results:

There are four elements to the confusion matrix:

  • True positives (TP): The number of times that the model predicts YES and the actual value is YES. In our example, this is 100 times.
  • True negatives (TN): The number of times that the model predicts NO and the actual value is NO. In our example, this is 60 times.
  • False positives (FP): The number of times that the model predicts YES and the actual value is NO. In our example, this is 15 times.
  • False negatives (FN): The number of times that the model predicts NO and the actual value is YES. In this example, this is 25 times.

Then, we calculate the confusion matrix in the following equation:

主站蜘蛛池模板: 岱山县| 扶绥县| 洛南县| 灯塔市| 开原市| 河间市| 会理县| 方城县| 武邑县| 赞皇县| 双流县| 蛟河市| 井研县| 铜鼓县| 康保县| 怀来县| 南丰县| 中方县| 元氏县| 肥东县| 兴仁县| 北辰区| 桦南县| 合川市| 砚山县| 喀喇沁旗| 潼南县| 沂水县| 名山县| 自治县| 玛曲县| 江西省| 宁强县| 镇远县| 开阳县| 大英县| 利川市| 五原县| 星座| 赤水市| 普兰县|