Skip to content

Commit

Permalink
Merge pull request #27 from pabloarosado/minor-refactor
Browse files Browse the repository at this point in the history
[REF] Rename function in exploration
  • Loading branch information
pabloarosado authored Aug 25, 2020
2 parents e499c81 + 65d6b8a commit 3cf4b45
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modev/exploration.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def expand_parameter_grid(grid, fixed_pars=default_pars.exploration_pars_fixed_p
return pars


def _split_approaches_name_and_pars(approaches_pars):
def expand_name_and_parameter_grids(approaches_pars):
app_names = []
app_pars = []
for name in approaches_pars:
Expand Down Expand Up @@ -66,7 +66,7 @@ def __init__(self, approaches_pars: dict, folds: list):

def initialise_results(self):
# TODO: Generalise this to save to/load from file.
app_names, app_pars = _split_approaches_name_and_pars(self.approaches_pars)
app_names, app_pars = expand_name_and_parameter_grids(self.approaches_pars)
app_ids = np.arange(len(app_pars))
# Repeat each pars combination for each fold.
pars_folds = pd.DataFrame(np.repeat(app_pars, len(self.folds)), columns=[default_pars.pars_key])
Expand Down Expand Up @@ -95,3 +95,7 @@ def get_next_point(self):
# TODO: Create RandomSearch with similar structure.
# TODO: Create AutoSearch with similar structure.
# In this case, _next_point_finder can use self.pars_folds at any time to see explored points and decide next.
# The structure of approaches_inputs is the same for grid, random and auto searches.
# In the cases of random and auto, only first and last element will be taken, and the rest ignored.
# In these cases, the type of the first element will determine whether it is int or float.
# If more than one approach are given, split the iterations among them.

0 comments on commit 3cf4b45

Please sign in to comment.