def test_decision_function_rocauc(self):
"""
Test ROCAUC with classifiers that have a decision function
"""
# Load the model and assert there is no predict_proba method.
model = LinearSVC()
with self.assertRaises(AttributeError):
model.predict_proba
# Fit model and visualizer
visualizer = ROCAUC(model)
visualizer.fit(X, yb)
expected = np.asarray([
0.204348, 0.228593, 0.219908, -0.211756, -0.26155 , -0.221405
])
# Get the predict_proba scores and evaluate
y_scores = visualizer._get_y_scores(X)
npt.assert_array_almost_equal(y_scores, expected, decimal=1)
评论列表
文章目录