From c655dcbb20723fa69f4f0660215447875913165a Mon Sep 17 00:00:00 2001 From: Ales Erjavec Date: Mon, 31 Jul 2023 11:19:03 +0200 Subject: [PATCH 1/2] owneuralnetwork: Remove learner_name setting redefinition --- Orange/widgets/model/owneuralnetwork.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Orange/widgets/model/owneuralnetwork.py b/Orange/widgets/model/owneuralnetwork.py index 72da1145a4d..59d18b10cff 100644 --- a/Orange/widgets/model/owneuralnetwork.py +++ b/Orange/widgets/model/owneuralnetwork.py @@ -79,7 +79,6 @@ class OWNNLearner(OWBaseLearner): solver = ["lbfgs", "sgd", "adam"] solv_lbl = ["L-BFGS-B", "SGD", "Adam"] - learner_name = Setting("Neural Network") hidden_layers_input = Setting("100,") activation_index = Setting(3) solver_index = Setting(2) From 9c0c57bbd2a8ffbf27af22a13638d6504cd54dd6 Mon Sep 17 00:00:00 2001 From: Ales Erjavec Date: Mon, 31 Jul 2023 13:37:55 +0200 Subject: [PATCH 2/2] WidgetLearnerTestMixin: Test for default learner names Fix widgets where learner_name setting is redefined to non empty string. --- Orange/widgets/model/owknn.py | 1 - Orange/widgets/model/owrules.py | 1 - Orange/widgets/model/owsgd.py | 1 - Orange/widgets/tests/base.py | 5 +++-- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Orange/widgets/model/owknn.py b/Orange/widgets/model/owknn.py index f21ca91bde6..40df819c4c3 100644 --- a/Orange/widgets/model/owknn.py +++ b/Orange/widgets/model/owknn.py @@ -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) diff --git a/Orange/widgets/model/owrules.py b/Orange/widgets/model/owrules.py index 959e6351591..1983e8861ae 100644 --- a/Orange/widgets/model/owrules.py +++ b/Orange/widgets/model/owrules.py @@ -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) diff --git a/Orange/widgets/model/owsgd.py b/Orange/widgets/model/owsgd.py index 5cbc343d20b..17a734d955f 100644 --- a/Orange/widgets/model/owsgd.py +++ b/Orange/widgets/model/owsgd.py @@ -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 diff --git a/Orange/widgets/tests/base.py b/Orange/widgets/tests/base.py index eaa1b125309..4d829a64f82 100644 --- a/Orange/widgets/tests/base.py +++ b/Orange/widgets/tests/base.py @@ -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()