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

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:

主站蜘蛛池模板: 车险| 称多县| 米林县| 航空| 加查县| 威海市| 唐海县| 清镇市| 呼玛县| 仙桃市| 响水县| 洛隆县| 宝山区| 新丰县| 迁西县| 泰州市| 阳新县| 和顺县| 全州县| 读书| 福州市| 万宁市| 广平县| 兰考县| 苍山县| 通许县| 兴化市| 怀来县| 武山县| 交城县| 巩义市| 阿巴嘎旗| 万安县| 潜江市| 北安市| 句容市| 广河县| 武宁县| 公安县| 白朗县| 社旗县|