Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0d16857

Browse filesBrowse files
committed
Lint
1 parent 708c668 commit 0d16857
Copy full SHA for 0d16857

File tree

1 file changed

+5
-5
lines changed
Filter options

1 file changed

+5
-5
lines changed

‎sklearn/neighbors/_subsampled.py

Copy file name to clipboardExpand all lines: sklearn/neighbors/_subsampled.py
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def subsampled_neighbors(self, X):
131131
the distance between them.
132132
133133
random_state : int or numpy.RandomState, default=None
134-
A pseudo random number generator object or a seed for it if int.
134+
A pseudo random number generator object or a seed for it if int.
135135
See :term: `Glossary <random_state>`.
136136
137137
Returns
@@ -152,12 +152,13 @@ def subsampled_neighbors(self, X):
152152
# Sample edges
153153
rows = np.repeat(np.arange(n), n_neighbors)
154154
cols = self.random_state_.randint(self.n_train_, size=n * n_neighbors)
155-
155+
156156
# No edges sampled
157157
if n_neighbors < 1:
158158
return csr_matrix((n, self.n_train_))
159159

160-
distances = paired_distances(X[rows], self.fit_X_[cols], metric=self.metric)
160+
distances = paired_distances(X[rows], self.fit_X_[cols],
161+
metric=self.metric)
161162

162163
# Keep only neighbors within epsilon-neighborhood
163164
if self.eps is not None:
@@ -177,7 +178,7 @@ def subsampled_neighbors(self, X):
177178
cols[start:stop] = cols[start:stop][dist_order]
178179

179180
# Sort column indices and label duplicates
180-
# When consecutive elements in sorted array are equal,
181+
# When consecutive elements in sorted array are equal,
181182
# it means there is a duplicate
182183
col_order = np.argsort(cols[start:stop], kind='mergesort')
183184
cols_tmp = cols[start:stop][col_order]
@@ -192,7 +193,6 @@ def subsampled_neighbors(self, X):
192193

193194
neighborhood = csr_matrix((distances, cols, indptr),
194195
shape=(n, self.n_train_))
195-
196196
return neighborhood
197197

198198
def _more_tags(self):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.