y_test = np.zeros((1000,1)) y_test[500:, 0]=1 cm_log_reg = metrics.confusion_matrix(y_test, y_pred) cm_log_reg
array([[498, 2], [ 1, 499]], dtype=int64)