Module optimizers
Function run_advanced_search
run_advanced_search(parameter_space: dict, obj_func: Callable[], max_eval: int, search_algo: str, model_type: str) -> dict
Performs advanced search over parameter space using Bayesian optimization or random search.
Args: parameter_space (dict): Parameter space in hyperopt format containing search spaces for each parameter. Example: obj_func (Callable): Function to be minimized that takes parameter dictionary as input and returns a dictionary containing 'loss' key. max_eval (int): Maximum number of parameter combinations to evaluate during optimization. search_algo (str): Algorithm used for parameter search:
- "bayes": Bayesian optimization using Tree of Parzen Estimators
- "random": Random search from uniform distribution model_type (str): Type of model being optimized, used for parameter type casting.
Returns: dict: Results dictionary containing:
- 'best_config': Dict with best parameters ('params') and corresponding loss value ('loss')
- 'trail': List of all evaluated configurations with their loss values
Function run_grid_search
run_grid_search(parameter_space: dict, obj_func: Callable[]) -> dict
Runs grid search on provided parameter space trying to minimize obj_func. Performs exhaustive search through all possible parameter combinations in the parameter space. Each combination is evaluated using the objective function to find the optimal configuration.
Args: parameter_space (dict): Dictionary containing parameter names as keys and lists of possible values Example: obj_func (Callable): Function to be minimized that takes parameter dictionary as input and returns a dictionary containing 'loss' key
Returns: dict: Results dictionary containing:
- 'best_config': Dict with best parameters ('params') and corresponding loss value ('loss')
- 'trail': List of all evaluated configurations with their loss values