Skip to content

Commit c882fcd

Browse files
authored
Merge pull request #1401 from BlazZupan/prevent-double-commit
[FIX] Lin and Log Regression: Prevent double commit
2 parents efb18b6 + 0f30c0f commit c882fcd

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

Orange/evaluation/testing.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,9 @@ def _is_picklable(obj):
347347
# multiprocessing (otherwise it shits itself at least on Windos)
348348
mp_queue = mp_ctx.Manager().Queue() if n_jobs > 1 else mp.Queue()
349349
except (EOFError, RuntimeError):
350-
raise RuntimeError('''
350+
mp_queue = mp.Queue()
351+
n_jobs = 1
352+
warnings.warn('''
351353
352354
Can't run multiprocessing code without a __main__ guard.
353355
@@ -365,8 +367,8 @@ def _is_picklable(obj):
365367
recursion ensues.
366368
367369
Guard your executed code with above Python idiom, or pass n_jobs=1
368-
to evaluation methods, i.e. {}(..., n_jobs=1).
369-
'''.format(self.__class__.__name__)) from None
370+
to evaluation methods, i.e. {}(..., n_jobs=1). Setting n_jobs to 1.
371+
'''.format(self.__class__.__name__), OrangeWarning)
370372

371373
data_splits = (
372374
(fold_i, self.preprocessor(train_data[train_i]), test_data[test_i])

Orange/widgets/classify/owlogisticregression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def add_main_layout(self):
4747
gui.widgetLabel(box2, "Weak").setStyleSheet("margin-top:6px")
4848
gui.hSlider(box2, self, "C_index",
4949
minValue=0, maxValue=len(self.C_s) - 1,
50-
callback=self.set_c, createLabel=False)
50+
callback=lambda: (self.set_c(), self.settings_changed()),
51+
createLabel=False)
5152
gui.widgetLabel(box2, "Strong").setStyleSheet("margin-top:6px")
5253
box2 = gui.hBox(box)
5354
box2.layout().setAlignment(Qt.AlignCenter)
@@ -58,7 +59,6 @@ def set_c(self):
5859
self.C = self.C_s[self.C_index]
5960
fmt = "C={}" if self.C >= 1 else "C={:.3f}"
6061
self.c_label.setText(fmt.format(self.C))
61-
self.settings_changed()
6262

6363
def create_learner(self):
6464
penalty = ["l1", "l2"][self.penalty_type]

Orange/widgets/regression/owlinearregression.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ def add_bottom_buttons(self):
8686
self.layout().setSizeConstraint(QLayout.SetFixedSize)
8787
self.alpha_slider.setEnabled(self.reg_type != self.OLS)
8888
self.l1_ratio_slider.setEnabled(self.reg_type == self.Elastic)
89-
self.commit()
9089

9190
def handleNewSignals(self):
9291
self.commit()

0 commit comments

Comments
 (0)