8000 Merge pull request #4537 from amueller/callibrated_classifier_cv_line… · scikit-learn/scikit-learn@2305bdc · GitHub
[go: up one dir, main page]

Skip to content

Commit 2305bdc

Browse files
committed
Merge pull request #4537 from amueller/callibrated_classifier_cv_linearsvc_seed
[MRG+2] FIX make CalibratedClassifierCV deterministic by default.
2 parents bfef25a + 2b66687 commit 2305bdc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sklearn/calibration.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ def fit(self, X, y, sample_weight=None):
124124

125125
self.calibrated_classifiers_ = []
126126
if self.base_estimator is None:
127-
base_estimator = LinearSVC()
127+
# we want all classifiers that don't expose a random_state
128+
# to be deterministic (and we don't want to expose this one).
129+
base_estimator = LinearSVC(random_state=0)
128130
else:
129131
base_estimator = self.base_estimator
130132

0 commit comments

Comments
 (0)
0