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

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:

主站蜘蛛池模板: 兴义市| 西丰县| 金平| 西峡县| 凌云县| 桂林市| 噶尔县| 彭泽县| 武宣县| 江西省| 辛集市| 叙永县| 汾西县| 阳新县| 石屏县| 沧源| 洪洞县| 石台县| 南阳市| 濮阳市| 平遥县| 三都| 靖州| 普兰县| 册亨县| 天全县| 九江县| 青神县| 剑阁县| 资讯 | 景东| 兴海县| 拜泉县| 比如县| 桐梓县| 阿鲁科尔沁旗| 广汉市| 宽甸| 广昌县| 红原县| 栾城县|