8000 Merge pull request #5402 from lesteve/fix-lshforest-doctest · scikit-learn/scikit-learn@2d97609 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2d97609

Browse files
committed
Merge pull request #5402 from lesteve/fix-lshforest-doctest
[MRG] fix non deterministic LSHForest doctest failure
2 parents b1619d0 + daf41d0 commit 2d97609

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sklearn/neighbors/approximate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,11 @@ class LSHForest(BaseEstimator, KNeighborsMixin, RadiusNeighborsMixin):
189189
190190
>>> X_train = [[5, 5, 2], [21, 5, 5], [1, 1, 1], [8, 9, 1], [6, 10, 2]]
191191
>>> X_test = [[9, 1, 6], [3, 1, 10], [7, 10, 3]]
192-
>>> lshf = LSHForest()
192+
>>> lshf = LSHForest(random_state=42)
193193
>>> lshf.fit(X_train) # doctest: +NORMALIZE_WHITESPACE
194194
LSHForest(min_hash_match=4, n_candidates=50, n_estimators=10,
195195
n_neighbors=5, radius=1.0, radius_cutoff_ratio=0.9,
196-
random_state=None)
196+
random_state=42)
197197
>>> distances, indices = lshf.kneighbors(X_test, n_neighbors=2)
198198
>>> distances # doctest: +ELLIPSIS
199199
array([[ 0.069..., 0.149...],

0 commit comments

Comments
 (0)
0