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

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:

主站蜘蛛池模板: 盖州市| 蒙阴县| 麟游县| 宜宾市| 抚远县| 祁东县| 朝阳区| 金寨县| 新疆| 正镶白旗| 神木县| 广昌县| 武穴市| 正安县| 克山县| 溆浦县| 牟定县| 花莲县| 荣成市| 莆田市| 南皮县| 盐城市| 大庆市| 乐平市| 余干县| 金门县| 额尔古纳市| 罗田县| 桑植县| 信丰县| 宁波市| 平遥县| 当雄县| 宜阳县| 太湖县| 宜都市| 山西省| 南岸区| 阿鲁科尔沁旗| 怀安县| 灵山县|