Skip to content

Commit

Permalink
fix positional and keyword args in ml/math test functions
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBlanke committed May 2, 2024
1 parent 846a410 commit e348bee
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@


class MachineLearningFunction(BaseTestFunction):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def __init__(self, metric, sleep, evaluate_from_data):
super().__init__(metric, sleep, evaluate_from_data)
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class KNeighborsClassifierFunction(MachineLearningFunction):

def __init__(
self,
metric="loss",
metric=None,
sleep=0,
evaluate_from_data=False,
):
Expand Down
18 changes: 14 additions & 4 deletions src/surfaces/test_functions/machine_learning/tabular_regressors.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ class KNeighborsRegressorFunction(MachineLearningFunction):
cv_default = [2, 3, 4, 5, 8, 10]
dataset_default = [diabetes_data]

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def __init__(
self,
metric=None,
sleep=0,
evaluate_from_data=False,
):
super().__init__(metric, sleep, evaluate_from_data)

def search_space(
self,
Expand Down Expand Up @@ -69,8 +74,13 @@ class GradientBoostingRegressorFunction(MachineLearningFunction):
cv_default = [2, 3, 4, 5, 8, 10]
dataset_default = [diabetes_data]

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def __init__(
self,
metric=None,
sleep=0,
evaluate_from_data=False,
):
super().__init__(metric, sleep, evaluate_from_data)

def search_space(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ class AckleyFunction(MathematicalFunction):
global_minimum = r"f(\vec{x}=0) = 0"

def __init__(
self, A=20, angle=2 * np.pi, metric="score", input_type="dictionary", sleep=0
self,
A=20,
angle=2 * np.pi,
metric="score",
input_type="dictionary",
sleep=0,
):
super().__init__(metric, input_type, sleep)

Expand Down

0 comments on commit e348bee

Please sign in to comment.