Skip to content

Commit

Permalink
WidgetLearnerTestMixin: Test for default learner names
Browse files Browse the repository at this point in the history
Fix widgets where learner_name setting is redefined to non empty string.
  • Loading branch information
ales-erjavec committed Jul 31, 2023
1 parent c655dcb commit 9c0c57b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion Orange/widgets/model/owknn.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class OWKNNLearner(OWBaseLearner):
weights_options = ["Uniform", "By Distances"]
metrics_options = ["Euclidean", "Manhattan", "Chebyshev", "Mahalanobis"]

learner_name = Setting("kNN")
n_neighbors = Setting(5)
metric_index = Setting(0)
weight_index = Setting(0)
Expand Down
1 change: 0 additions & 1 deletion Orange/widgets/model/owrules.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ class OWRuleLearner(OWBaseLearner):
storage_measures = ["entropy", "laplace", "wracc"]

# default parameter values
learner_name = Setting("CN2 rule inducer")
rule_ordering = Setting(0)
covering_algorithm = Setting(0)
gamma = Setting(0.7)
Expand Down
1 change: 0 additions & 1 deletion Orange/widgets/model/owsgd.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class Outputs(OWBaseLearner.Outputs):
('Optimal', 'optimal'),
('Inverse scaling', 'invscaling'))

learner_name = Setting('SGD')
#: Loss function index for classification problems
cls_loss_function_index = Setting(0)
#: Epsilon loss function parameter for classification problems
Expand Down
5 changes: 3 additions & 2 deletions Orange/widgets/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,9 @@ def test_output_learner_name(self):
new_name = "Learner Name"
self.click_apply()
self.assertEqual(self.widget.learner.name,
self.widget.name_line_edit.text()
or self.widget.name_line_edit.placeholderText())
self.widget.effective_learner_name())
self.assertEqual(self.widget.effective_learner_name(),
self.widget.name_line_edit.placeholderText())
self.widget.name_line_edit.setText(new_name)
self.click_apply()
self.wait_until_stop_blocking()
Expand Down

0 comments on commit 9c0c57b

Please sign in to comment.