Commit 246fd19
1 parent 1957e63 commit 246fd19
File tree
3 files changed
+56
-13
lines changed- sklearn/neighbors
3 files changed
+56
-13
lines changedLines changed: 44 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
239 | 239 |
| |
240 | 240 |
| |
241 | 241 |
| |
242 |
| - | |
| 242 | + | |
| 243 | + | |
243 | 244 |
| |
244 |
| - | |
| 245 | + | |
245 | 246 |
| |
246 | 247 |
| |
247 | 248 |
| |
| |||
1159 | 1160 |
| |
1160 | 1161 |
| |
1161 | 1162 |
| |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
1162 | 1173 |
| |
1163 | 1174 |
| |
1164 | 1175 |
| |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
1165 | 1181 |
| |
1166 | 1182 |
| |
1167 | 1183 |
| |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
1168 | 1194 |
| |
1169 | 1195 |
| |
1170 | 1196 |
| |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
1171 | 1207 |
| |
1172 | 1208 |
| |
1173 | 1209 |
| |
| |||
1362 | 1398 |
| |
1363 | 1399 |
| |
1364 | 1400 |
| |
1365 |
| - | |
| 1401 | + | |
| 1402 | + | |
1366 | 1403 |
| |
1367 | 1404 |
| |
1368 | 1405 |
| |
| |||
1694 | 1731 |
| |
1695 | 1732 |
| |
1696 | 1733 |
| |
1697 |
| - | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
1698 | 1738 |
| |
1699 | 1739 |
| |
1700 | 1740 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
110 | 110 |
| |
111 | 111 |
| |
112 | 112 |
| |
113 |
| - | |
114 | 113 |
| |
| 114 | + | |
| 115 | + | |
| 116 | + | |
115 | 117 |
| |
116 | 118 |
| |
117 | 119 |
| |
|
Lines changed: 9 additions & 8 deletions
<
6D40
table aria-label="Diff for: sklearn/neighbors/_lof.py" class="tab-size width-full DiffLines-module__tableLayoutFixed--ZmaVx" data-diff-anchor="diff-4f91df0fe0863d0fb7bd4744a87ff4e2e8dd75599da0eebdbaaf4eb02872d6cd" data-tab-size="8" data-paste-markdown-skip="true" role="grid" style="--line-number-cell-width:44px;--line-number-cell-width-unified:88px">Original file line number Diff line number Diff line change
@@ -176,8 +176,9 @@ def __init__(self, n_neighbors=20, algorithm='auto', leaf_size=30,
176
176
177
177
@property
178
178
def fit_predict(self):
179
- """"Fits the model to the training set X and returns the labels.
179
+ """Fits the model to the training set X and returns the labels.
180
180
181
+ **Only available for novelty detection (when novelty is set to True).**
181
182
Label is 1 for an inlier and -1 for an outlier according to the LOF
182
183
score and the contamination parameter.
183
184
@@ -207,7 +208,7 @@ def fit_predict(self):
207
208
return self._fit_predict
208
209
209
210
def _fit_predict(self, X, y=None):
210
- """"Fits the model to the training set X and returns the labels.
211
+ """Fits the model to the training set X and returns the labels.
211
212
212
213
Label is 1 for an
9E88
inlier and -1 for an outlier according to the LOF
213
214
score and the contamination parameter.
@@ -286,9 +287,9 @@ def fit(self, X, y=None):
286
287
def predict(self):
287
288
"""Predict the labels (1 inlier, -1 outlier) of X according to LOF.
288
289
290
+ **Only available for novelty detection (when novelty is set to True).**
289
291
This method allows to generalize prediction to *new observations* (not
290
- in the training set). Only available for novelty detection (when
291
- novelty is set to True).
292
+ in the training set).
292
293
293
294
Parameters
294
295
----------
@@ -345,8 +346,8 @@ def decision_function(self):
345
346
346
347
Bigger is better, i.e. large values correspond to inliers.
347
348
349
+ **Only available for novelty detection (when novelty is set to True).**
348
350
The shift offset allows a zero threshold for being an outlier.
349
- Only available for novelty detection (when novelty is set to True).
350
351
The argument X is supposed to contain *new data*: if X contains a
351
352
point from training, it considers the later in its own neighborhood.
352
353
Also, the samples in X are not considered in the neighborhood of any
@@ -381,8 +382,8 @@ def _decision_function(self, X):
381
382
382
383
Bigger is better, i.e. large values correspond to inliers.
383
384
385
+ **Only available for novelty detection (when novelty is set to True).**
384
386
The shift offset allows a zero threshold for being an outlier.
385
- Only available for novelty detection (when novelty is set to True).
386
387
The argument X is supposed to contain *new data*: if X contains a
387
388
point from training, it considers the later in its own neighborhood.
388
389
Also, the samples in X are not considered in the neighborhood of any
@@ -411,7 +412,7 @@ def score_samples(self):
411
412
It is the opposite as bigger is better, i.e. large values correspond
412
413
to inliers.
413
414
414
- Only available for novelty detection (when novelty is set to True).
415
+ **Only available for novelty detection (when novelty is set to True).**
415
416
The argument X is supposed to contain *new data*: if X contains a
416
417
point from training, it considers the later in its own neighborhood.
417
418
Also, the samples in X are not considered in the neighborhood of any
@@ -447,7 +448,7 @@ def _score_samples(self, X):
447
448
It is the opposite as bigger is better, i.e. large values correspond
448
449
to inliers.
449
450
450
- Only available for novelty detection (when novelty is set to True).
451
+ **Only available for novelty detection (when novelty is set to True).**
451
452
The argument X is supposed to contain *new data*: if X contains a
452
453
point from training, it considers the later in its own neighborhood.
453
454
Also, the samples in X are not considered in the neighborhood of any
0 commit comments