def test_recall_binary(): obj = Recall() assert obj.score(np.array([0, 0, 0, 1, 1, 1]), np.array([1, 1, 1, 1, 1, 1])) == pytest.approx(1.0, EPS) assert obj.score(np.array([0, 0, 0, 1, 1, 1]), np.array([0, 0, 0, 0, 0, 0])) == pytest.approx(0.0, EPS) assert obj.score(np.array([1, 1, 1, 1, 1, 1]), np.array([0, 0, 0, 1, 1, 1])) == pytest.approx(0.5, EPS)
def test_recall_object(X_y_binary): X, y = X_y_binary automl = AutoMLSearch(X_train=X, y_train=y, problem_type='binary', objective=Recall(), max_iterations=1, n_jobs=1) automl.search() assert len(automl.full_rankings) > 0 assert automl.objective.name == 'Recall'