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

Classification metrics

In Keras, we can find the following classification metrics:

  • Binary accuracy: This measures the accuracy of the result of a binary classification problem. In keras, it's possible to use the functions binary_accuracy and acc.
  • ROC AUC: It measures the AUC of a binary classification problem. In keras, it's possible to use the functions categorical_accuracy and acc.
  • Categorical accuracy: It measures the accuracy of the result of a multiclass classification problem. In keras, it's possible to use the categorical_accuracy and acc functions.
  • Sparse categorical accuracy: It has the same functionality of categorical accuracy but for a sparse problem, sparse_categorical_accuracy.
  • Top k categorical accuracy: It returns the accuracy of the top k elements. In keras, it's possible to use the top_k_categorical_accuracy functions (this requires you to specify a k parameter).
  • Sparse top k categorical accuracy: It returns the accuracy of the top k elements. In keras, it's possible to use the sparse_top_k_categorical_accuracy function (requires you to specify a k parameter).

The first thing we need to determine is whether the dataset in is either balanced or unbalanced, regarding the classes we need to predict. If the dataset is unbalanced (for example, 99% if the instances belong to only one class), metrics such as precision and accuracy can be misleading. In that case, if our system always predicts the most common class, both precision and recall will look very good, but the system will be totally useless. That's why it's important to choose metrics that are useful for the system we are modeling. In this case, for example, ROC AUC will be better as it's looking at the misclassifications our algorithm does and how bad the error is.

主站蜘蛛池模板: 库伦旗| 蕲春县| 柘荣县| 环江| 上林县| 新宁县| 固原市| 贞丰县| 麻江县| 清徐县| 巨鹿县| 隆回县| 闽清县| 松桃| 伊宁县| 慈溪市| 道孚县| 奇台县| 宁南县| 十堰市| 吴堡县| 镇沅| 弥勒县| 普格县| 江山市| 本溪市| 太保市| 武川县| 达孜县| 密云县| 乳源| 德令哈市| 海林市| 达孜县| 濮阳市| 漳州市| 正安县| 郑州市| 闸北区| 龙泉市| 伊通|