mlwiz.evaluation
evaluation.config
- class mlwiz.evaluation.config.Config(config_dict: dict)
Bases:
objectSimple class to manage the configuration dictionary as a Python object with fields.
- Parameters:
config_dict (dict) – the configuration dictionary
- get(key: str, default: object | None = None) object
Returns the key from the dictionary if present, otherwise the default value specified
- Parameters:
key (str) – the key to look up in the dictionary
default (object) – the default object
- Returns:
a value from the dictionary
- items() list
Invokes the items() method of the configuration dictionary
- Returns:
a list of (key, value) pairs
- keys() set
Invokes the keys() method of the configuration dictionary
- Returns:
the set of keys in the dictionary
evaluation.evaluator
evaluation.grid
- class mlwiz.evaluation.grid.Grid(configs_dict: dict)
Bases:
objectClass that implements grid-search. It computes all possible configurations starting from a suitable config file.
- Parameters:
configs_dict (dict) – the configuration dictionary specifying the different configurations to try
- _gen_configs() List[dict]
Takes a dictionary of key:list pairs and computes all possible combinations.
- Returns:
A list of al possible configurations in the form of dictionaries
- _gen_helper(cfgs_dict: dict) dict
Helper generator that yields one possible configuration at a time.
- _list_helper(values: object) object
Recursively parses lists of possible options for a given hyper-parameter.
- property exp_name: str
Computes the name of the root folder
- Returns:
the name of the root folder as made of
EXP-NAME_DATASET-NAME
- property num_configs: int
Computes the number of configurations to try during model selection
- Returns:
the number of configurations
evaluation.random_search
- class mlwiz.evaluation.random_search.RandomSearch(configs_dict: dict)
Bases:
GridClass that implements random-search. It computes all possible configurations starting from a suitable config file.
- Parameters:
configs_dict (dict) – the configuration dictionary specifying the different configurations to try
- _dict_helper(configs: dict)
Recursively parses a dictionary
- Returns:
A dictionary
- _gen_helper(cfgs_dict: dict) Iterator[Dict[str, Any]]
Takes a dictionary of key:list pairs and computes all possible combinations.
- Returns:
A list of all possible configurations in the form of dictionaries
- _sampler_helper(configs: dict)
Samples possible hyperparameter(s) and returns it (them, in this case as a dict)
- Returns:
A dictionary