![Machine Learning with Swift](https://wfqqreader-1252317822.image.myqcloud.com/cover/164/36700164/b_36700164.jpg)
上QQ阅读APP看书,第一时间看更新
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=1738842710-n4jvfCnIGjDHCQy4CoW1kDY6wncAZC56-0-9d8ed7758288c8288a0b14727b7df2bd)
The bigger the numbers on the matrix diagonally, the better.