Permalink
Browse files

OPTIM: minor optimization

  • Loading branch information...
1 parent a595754 commit c78b1d29d358c24679eac468b7d272f64e91a3d3 @GaelVaroquaux GaelVaroquaux committed Dec 29, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 sklearn/ensemble/forest.py
@@ -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)

0 comments on commit c78b1d2

Please sign in to comment.