Skip to content

Commit ea7c5c3

Browse files
author
Max Moroz
committed
fixed memory / efficiency issue in DummyClassifier(strategy='most_frequent')
1 parent 7cb9a23 commit ea7c5c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sklearn/dummy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def predict_proba(self, X):
272272
P = []
273273
for k in range(self.n_outputs_):
274274
if self.strategy == "most_frequent":
275-
ind = np.ones(n_samples, dtype=int) * class_prior_[k].argmax()
275+
ind = class_prior_[k].argmax()
276276
out = np.zeros((n_samples, n_classes_[k]), dtype=np.float64)
277277
out[:, ind] = 1.0
278278
elif self.strategy == "prior":

0 commit comments

Comments
 (0)