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

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:

主站蜘蛛池模板: 珲春市| 凤城市| 梅河口市| 万盛区| 邮箱| 多伦县| 运城市| 桑日县| 贡嘎县| 周至县| 蓝山县| 仙桃市| 中牟县| 托克托县| 房产| 西畴县| 年辖:市辖区| 平陆县| 苍溪县| 临沭县| 大宁县| 遂溪县| 无极县| 桓台县| 温宿县| 宝山区| 南充市| 观塘区| 汝南县| 朔州市| 泰和县| 方城县| 彭阳县| 乌拉特中旗| 和田市| 宜兰县| 淳安县| 康定县| 江川县| 子长县| 梓潼县|