ForeTiS.utils.helper_functions

Module Contents

Functions

get_list_of_implemented_models()

Create a list of all implemented models based on files existing in 'model' subdirectory of the repository.

get_mapping_name_to_class()

Get a mapping from model name (naming in package model without .py) to class name.

set_all_seeds([seed])

Set all seeds of libs with a specific function for reproducibility of results

get_indexes(df, datasplit, folds, seasonal_valtest, ...)

Get the indexes for cv

get_datasplit_config_info_for_resultfolder(resultfolder)

Get all datasplit info for a result folder

ForeTiS.utils.helper_functions.get_list_of_implemented_models()

Create a list of all implemented models based on files existing in ‘model’ subdirectory of the repository.

Return type:

list

ForeTiS.utils.helper_functions.get_mapping_name_to_class()

Get a mapping from model name (naming in package model without .py) to class name.

Returns:

dictionary with mapping model name to class name

Return type:

dict

ForeTiS.utils.helper_functions.set_all_seeds(seed=42)

Set all seeds of libs with a specific function for reproducibility of results

Parameters:

seed (int) – seed to use

ForeTiS.utils.helper_functions.get_indexes(df, datasplit, folds, seasonal_valtest, valtest_seasons, seasonal_periods, val_set_size_percentage)

Get the indexes for cv

Parameters:
  • df (pandas.DataFrame) – data that should be splited

  • datasplit (str) – splitting method

  • folds (int) – number of folds of the hyperparameter optimization

  • valtest_seasons (int) – the number of seasons to be used for validation and testing when seasonal_valtest is True

  • seasonal_periods (int) – how many datapoints one season has

  • test_set_size_percentage – size of the test set relevant for cv-test and train-val-test

  • val_set_size_percentage (int) – size of the validation set relevant for train-val-test

Returns:

train and test indexes

ForeTiS.utils.helper_functions.get_datasplit_config_info_for_resultfolder(resultfolder)

Get all datasplit info for a result folder

Parameters:

resultfolder (str) – path to retrieve info

Returns:

datasplit info with datasplit, n_outerfolds, n_innerfolds, val_set_size_percentage, test_set_size_percentage, maf_percentage

Return type:

tuple