Skip to content

Commit 0d16857

Browse files
committed
Lint
1 parent 708c668 commit 0d16857

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sklearn/neighbors/_subsampled.py

Lines 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)