Skip to content

Commit

Permalink
take into account raghav comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoix authored and agramfort committed May 22, 2016
1 parent f4a513a commit ce45d36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions benchmarks/bench_isolation_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
np.random.seed(1)

datasets = ['http', 'smtp', 'SA', 'SF', 'shuttle', 'forestcover']
# datasets = ['http']

for dat in datasets:
# loading and vectorization
Expand All @@ -34,7 +33,7 @@
dataset = fetch_mldata('shuttle')
X = dataset.data
y = dataset.target
sh(X, y)
X, y = sh(X, y)
# we remove data with label 4
# normal data are then those of class 1
s = (y != 4)
Expand Down Expand Up @@ -95,7 +94,7 @@
scoring = - model.decision_function(X_test) # the lower, the more normal

# Show score histograms
f, ax = plt.subplots(3, sharex=True, sharey=True)
fig, ax = plt.subplots(3, sharex=True, sharey=True)
bins = np.linspace(-0.5, 0.5, 200)
ax[0].hist(scoring, bins, color='black')
ax[0].set_title('decision function for %s dataset' % dat)
Expand Down
4 changes: 2 additions & 2 deletions sklearn/ensemble/iforest.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def fit(self, X, y=None, sample_weight=None):
return self

def predict(self, X):
"""Outlyingness of observations in X according to the fitted model.
"""Predict if a particular sample is an outlier or not.
Parameters
----------
Expand All @@ -206,7 +206,7 @@ def predict(self, X):
-------
is_inlier : array, shape = (n_samples, )
For each observations, tells whether or not (+1 or -1) it should
be considered as an outlier according to the fitted model.
be considered as an inlier according to the fitted model.
"""
X = check_array(X, accept_sparse='csr')
Expand Down

0 comments on commit ce45d36

Please sign in to comment.