- Machine Learning with Swift
- Alexander Sosnovshchenko
- 47字
- 2021-06-24 18:54:59
Confusion matrix
Confusion matrix helps to see what types of errors occur more often:
In []: from sklearn.metrics import confusion_matrix confusion_matrix(y_test, tree_model.predict(X_test)) Out[]: array([[128, 20], [ 17, 135]])
This is how to read and interpret such matrices:
![](https://epubservercos.yuewen.com/A3C592/19470396901583706/epubprivate/OEBPS/Images/010.jpg?sign=1739684111-vCe9a0N8RQ7jvCOSRcop5yZSwuLBf8MJ-0-a449c5ff7cc82a55311597cbcf5ceed5)
The bigger the numbers on the matrix diagonally, the better.