diff --git a/quantile_forest/_quantile_forest_fast.pyx b/quantile_forest/_quantile_forest_fast.pyx index e2928bf..690dd4b 100755 --- a/quantile_forest/_quantile_forest_fast.pyx +++ b/quantile_forest/_quantile_forest_fast.pyx @@ -885,6 +885,7 @@ cdef class QuantileForest: if train_indices[k].size() == 0: continue + # Clear list of training target values. leaf_samples.clear() # Get training target values associated with indices. diff --git a/quantile_forest/tests/test_quantile_forest.py b/quantile_forest/tests/test_quantile_forest.py index eaac0c3..f01e6aa 100755 --- a/quantile_forest/tests/test_quantile_forest.py +++ b/quantile_forest/tests/test_quantile_forest.py @@ -680,6 +680,7 @@ def check_quantile_ranks(name): assert y_ranks.shape == (X_test.shape[0], 2) assert np.all(y_ranks >= 0) assert np.all(y_ranks <= 1) + assert np.all(y_ranks[:, 0] < y_ranks[:, 1]) @pytest.mark.parametrize("name", FOREST_REGRESSORS)