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

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:

主站蜘蛛池模板: 永昌县| 紫阳县| 曲松县| 武川县| 平舆县| 夏津县| 鸡西市| 泰安市| 黔东| 宜昌市| 临城县| 无棣县| 甘德县| 新和县| 宜兰县| 南昌市| 揭西县| 东源县| 荔浦县| 广德县| 齐河县| 甘肃省| 田阳县| 宁德市| 闽清县| 金塔县| 彭泽县| 方山县| 罗平县| 都安| 河曲县| 邹平县| 康平县| 宕昌县| 民勤县| 封丘县| 华亭县| 孟连| 车致| 格尔木市| 东乌珠穆沁旗|