混同行列を読み解く
モデルがどこで誤るかを正確に確認する
「混同行列を読み解く」はCoddyKit上の無料NLP Academyレッスンです。 これはレッスン3/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはNLP Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 NLP Academyコースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
The Whole Picture
The confusion matrix is a small table showing every prediction sorted by what was true and what you guessed. It reveals exactly where errors live.
Rows and Columns
Rows are the true labels and columns are the predicted ones. Each cell counts how many examples fell into that true-versus-predicted combination.
The Four Cells
For two classes you get four counts: true positives, true negatives, and the two error types. Every metric you know is built from these.
True Positive
A true positive is a real positive you correctly flagged, like real spam sent straight to the spam folder. A clean win.
True Negative
A true negative is a real negative you correctly left alone, like a normal email that stays safely in the inbox.
False Positive
A false positive is a false alarm: you flagged something that was actually negative, like a real email wrongly marked as spam.
False Negative
A false negative is a miss: a real positive you let slip through, like spam that lands in the inbox unflagged.
The Diagonal Tells All
Correct predictions sit on the diagonal. A strong model concentrates counts there and leaves the off-diagonal cells nearly empty.
Build It in Python
scikit-learn assembles the matrix from your true and predicted labels in a single call.
from sklearn.metrics import confusion_matrix
cm = confusion_matrix(y_true, y_pred)Make It Readable
A plotted matrix makes errors jump out, so you instantly see which class gets confused for which.
from sklearn.metrics import ConfusionMatrixDisplay
ConfusionMatrixDisplay(cm).plot()Spotting the Weak Spot
Read off-diagonal cells to find the model blind spot. A large false-negative count, for example, warns you that real positives are being missed.
Quick Check
Name the error type from the description.
Recap
The confusion matrix splits results into four cells. The diagonal holds wins; off-diagonal cells expose exactly where your model errs. 🔍
よくある質問
「混同行列を読み解く」レッスンは無料ですか?
はい。「混同行列を読み解く」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、NLP Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 NLP Academyコースには全4レッスンが含まれています。
「混同行列を読み解く」で何を学びますか?
モデルがどこで誤るかを正確に確認する ブラウザで直接実行するハンズオンコードでNLP Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
NLP Academyを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのNLP Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン3/4です。
「混同行列を読み解く」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このNLP Academyレッスンでコードを書いて実行できますか?
はい。すべてのNLP Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- 正解率が信頼できない理由
- 適合率、再現率、F1
- 混同行列を読み解く
- 交差検証を正しく行う