Skip to content

Commit

Permalink
Add unit test for rank checks
Browse files Browse the repository at this point in the history
  • Loading branch information
reidjohnson committed Sep 4, 2024
1 parent 7081e51 commit e6d7d63
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions quantile_forest/tests/test_quantile_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,10 @@ def check_quantile_ranks(name):
assert np.all(y_ranks <= 1)
assert np.all(y_ranks[:, 0] < y_ranks[:, 1])

# Check error if training and test number of targets are not equal.
est.fit(X_train, y_train[:, 0]) # training target size = 1
assert_raises(ValueError, est.quantile_ranks, X_test, y_test[:, :2]) # test target size = 2


@pytest.mark.parametrize("name", FOREST_REGRESSORS)
def test_quantile_ranks(name):
Expand Down

0 comments on commit e6d7d63

Please sign in to comment.