混同行列とは何ですか?
混同行列は、モデルの性能を評価するために使用される表です classification algorithm. It provides a comprehensive view of how well the model is performing by summarizing the results of predictions made モデルによって。
混同行列の構成要素
混同行列は通常、4つの主要な要素で構成されています:
- 真陽性(TP): 正と正しく予測されたインスタンスの数。
- 真陰性(TN): 負と正しく予測されたインスタンスの数。
- 偽陽性(FP): The number of instances incorrectly predicted as positive (also known as Type I error).
- 偽陰性(FN): The number of instances incorrectly predicted as negative (also known as Type II error).
行列の理解
混同行列の構造は次のように示すことができます:
Predicted Positive Predicted Negative
Actual Positive TP FN
Actual Negative FP TN
This layout helps in visualizing the performance of the classification model, allowing for the calculation of various 性能指標.
パフォーマンス指標
混同行列の値から、いくつかの重要な性能指標を導き出すことができます:
- 正確さ: (TP + TN) / (TP + TN + FP + FN)
- 精度: TP / (TP + FP)
- 想起 (感度): TP / (TP + FN)
- F1スコア: 2 * (適合率 * 再現率) / (適合率 + 再現率)
これらの指標は、モデルが正しく正と負のインスタンスを識別する能力を判断するのに役立ちます。良く構築された混同行列は、分類モデルの長所と短所を理解するために不可欠です。