Viewing false positive rows in python
I got values for the confusion matrix using:
tn, fp, fn, tp = confusion_matrix(y_true, y_pred).ravel()
10000 13000 500 1500
Now, I wish to see what data is in the each tn, fp, fn, and tp.
I have tried various options, but the kernel keeps on dying. I am working with Python3 on Jupyter Notebook.
X_train, X_test, y_train, y_test = train_test_split( X, y, train_size=5000, random_state=1)
X_train.shape, y_train.shape, X_test.shape, y_test.shape
((5000, 21), (5000, 1), (25000, 21), (25000, 1))
y_pred = pd.Series(clf_iforest.predict(X_test))
For example, this is the last one I have tried:
concatpredtest = pd.concat([y_pred, X_test], axis=1, join='inner')
fp_filter = (y_test == 1) (concatpredtest == 0)
Do you know what could I do to see my false positive rows - of course entire row i.e. X_test
along with y_pred
?
Topic confusion-matrix
Category Data Science