Skip to content

Commit ce45d36

Browse files
ngoixagramfort
authored andcommitted
take into account raghav comments
1 parent f4a513a commit ce45d36

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

benchmarks/bench_isolation_forest.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
np.random.seed(1)
2121

2222
datasets = ['http', 'smtp', 'SA', 'SF', 'shuttle', 'forestcover']
23-
# datasets = ['http']
2423

2524
for dat in datasets:
2625
# loading and vectorization
@@ -34,7 +33,7 @@
3433
dataset = fetch_mldata('shuttle')
3534
X = dataset.data
3635
y = dataset.target
37-
sh(X, y)
36+
X, y = sh(X, y)
3837
# we remove data with label 4
3938
# normal data are then those of class 1
4039
s = (y != 4)
@@ -95,7 +94,7 @@
9594
scoring = - model.decision_function(X_test) # the lower, the more normal
9695

9796
# Show score histograms
98-
f, ax = plt.subplots(3, sharex=True, sharey=True)
97+
fig, ax = plt.subplots(3, sharex=True, sharey=True)
9998
bins = np.linspace(-0.5, 0.5, 200)
10099
ax[0].hist(scoring, bins, color='black')
101100
ax[0].set_title('decision function for %s dataset' % dat)

sklearn/ensemble/iforest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def fit(self, X, y=None, sample_weight=None):
193193
return self
194194

195195
def predict(self, X):
196-
"""Outlyingness of observations in X according to the fitted model.
196+
"""Predict if a particular sample is an outlier or not.
197197
198198
Parameters
199199
----------
@@ -206,7 +206,7 @@ def predict(self, X):
206206
-------
207207
is_inlier : array, shape = (n_samples, )
208208
For each observations, tells whether or not (+1 or -1) it should
209-
be considered as an outlier according to the fitted model.
209+
be considered as an inlier according to the fitted model.
210210
211211
"""
212212
X = check_array(X, accept_sparse='csr')

0 commit comments

Comments
 (0)