Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 5, 2024
1 parent ac48754 commit 3e00bfe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_isoforest.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def test_reproducibility():
forest2 = build_forest(n_features, random_seed)
assert_forest_scores(forest1, forest2, n_features=n_features)


def test_apply():
n_features = 16
n_trees = 100
Expand All @@ -129,9 +130,10 @@ def test_apply():
forest.fit(data)

scores = np.sum(forest.evaluator.selectors[forest.apply(data)]["value"], axis=1)
scores = -2**(-scores / (forest.evaluator.average_path_length(n_subsamples) * n_trees))
scores = -(2 ** (-scores / (forest.evaluator.average_path_length(n_subsamples) * n_trees)))
assert_allclose(forest.score_samples(data), scores)


@pytest.mark.regression
def test_regression(regression_data):
random_seed = 0
Expand Down

0 comments on commit 3e00bfe

Please sign in to comment.