Skip to content

Commit

Permalink
Merge pull request scikit-learn#5796 from max-moroz/dummy_classifier_…
Browse files Browse the repository at this point in the history
…memory_efficiency

[MRG+1] memory issue in DummyClassifier(strategy='most_frequent')
  • Loading branch information
agramfort committed Nov 12, 2015
2 parents 7cb9a23 + ea7c5c3 commit ce90ccb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sklearn/dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def predict_proba(self, X):
P = []
for k in range(self.n_outputs_):
if self.strategy == "most_frequent":
ind = np.ones(n_samples, dtype=int) * class_prior_[k].argmax()
ind = class_prior_[k].argmax()
out = np.zeros((n_samples, n_classes_[k]), dtype=np.float64)
out[:, ind] = 1.0
elif self.strategy == "prior":
Expand Down

0 comments on commit ce90ccb

Please sign in to comment.