From e31a672ba4dc8a9b605cb02882f8afbfa4bbbe7b Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 8 Mar 2024 10:54:20 +0100 Subject: symreg hyper param --- lib/functions.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'lib') diff --git a/lib/functions.py b/lib/functions.py index be4f56b..212e47a 100644 --- a/lib/functions.py +++ b/lib/functions.py @@ -1537,17 +1537,21 @@ class SymbolicRegressionFunction(SKLearnRegressionFunction): return rstr.count(",") * 2 + 1 def hyper_to_dref(self): - return { - "symreg/population size": self.regressor.population_size, - "symreg/generations": self.regressor.generations, - "symreg/tournament size": self.regressor.tournament_size, - "symreg/const range/min": self.regressor.const_range[0], - "symreg/const range/max": self.regressor.const_range[1], - "symreg/function set": " ".join(self.regressor.function_set), - "symreg/metric": self.regressor.metric, - "symreg/parsimony coefficient": self.regressor.parsimony_coefficient, - "symreg/n jobs": self.regressor.n_jobs, - } + hyper = super().hyper_to_dref() + hyper.update( + { + "symreg/population size": self.regressor.population_size, + "symreg/generations": self.regressor.generations, + "symreg/tournament size": self.regressor.tournament_size, + "symreg/const range/min": self.regressor.const_range[0], + "symreg/const range/max": self.regressor.const_range[1], + "symreg/function set": " ".join(self.regressor.function_set), + "symreg/metric": self.regressor.metric, + "symreg/parsimony coefficient": self.regressor.parsimony_coefficient, + "symreg/n jobs": self.regressor.n_jobs, + } + ) + return hyper # first-order linear function (no feature interaction) -- cgit v1.2.3