Skip to content

Commit

Permalink
OPTIM: minor optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
GaelVaroquaux committed Dec 29, 2011
1 parent a595754 commit c78b1d2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sklearn/ensemble/forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ def fit(self, X, y):
X = np.atleast_2d(X)
y = np.atleast_1d(y)

sample_mask = np.ones((X.shape[0],), dtype=np.bool)
X_argsorted = np.asfortranarray(
np.argsort(X.T, axis=1).astype(np.int32).T)
if not self.bootstrap:
sample_mask = np.ones((X.shape[0],), dtype=np.bool)
X_argsorted = np.asfortranarray(
np.argsort(X.T, axis=1).astype(np.int32).T)

if isinstance(self.base_estimator, ClassifierMixin):
self.classes_ = np.unique(y)
Expand Down

0 comments on commit c78b1d2

Please sign in to comment.