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

  • Hands-On Neural Networks
  • Leonardo De Marchi Laura Mitchell
  • 288字
  • 2021-06-24 14:00:12

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.

主站蜘蛛池模板: 舟山市| 方山县| 新兴县| 五常市| 阳东县| 营山县| 南漳县| 玉田县| 临江市| 桑日县| 新乡县| 临清市| 灌云县| 如东县| 高清| 从江县| 孝昌县| 友谊县| 雷州市| 讷河市| 奉节县| 阜新市| 凉城县| 犍为县| 木兰县| 莒南县| 彩票| 广昌县| 留坝县| 滨州市| 临武县| 星子县| 广安市| 岫岩| 青田县| 义乌市| 新乡市| 新平| 柳林县| 鄱阳县| 全椒县|