Skip to content

Commit

Permalink
changed the mutable input lists
Browse files Browse the repository at this point in the history
  • Loading branch information
Caparrini committed Jan 23, 2024
1 parent 047f09c commit c827d12
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mloptimizer/genoptimizer/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ class BaseOptimizer(object):
__metaclass__ = ABCMeta

def __init__(self, features: np.array, labels: np.array, folder=os.curdir, log_file="mloptimizer.log",
custom_hyperparams: dict = {},
custom_fixed_hyperparams: dict = {}, eval_function=train_score,
custom_hyperparams=None,
custom_fixed_hyperparams=None, eval_function=train_score,
score_function=accuracy_score, seed=random.randint(0, 1000000)):
"""
Creates object BaseOptimizer.
Expand All @@ -99,6 +99,10 @@ def __init__(self, features: np.array, labels: np.array, folder=os.curdir, log_f
seed for the random functions (deap, models, and splits on evaluations)
"""
# Input mandatory variables
if custom_fixed_hyperparams is None:
custom_fixed_hyperparams = {}
if custom_hyperparams is None:
custom_hyperparams = {}
self.features = features
self.labels = labels
# Input hyperparameters (optional)
Expand Down

0 comments on commit c827d12

Please sign in to comment.