ml_grid.util.bayes_utils ======================== .. py:module:: ml_grid.util.bayes_utils Functions --------- .. autoapisummary:: ml_grid.util.bayes_utils.calculate_combinations Module Contents --------------- .. py:function:: calculate_combinations(parameter_space: Union[Dict[str, Any], List[Dict[str, Any]]], steps: int = 10) -> int Approximates the number of parameter combinations for hyperparameter search. This function supports both a single dictionary or a list of dictionaries for the parameter space. It is useful for estimating the size of a search space, especially for Bayesian optimization where continuous parameters are sampled. :param parameter_space: A single dictionary or a list of dictionaries representing the parameter space. Keys are parameter names, and values can be `skopt.space` objects (Real, Integer, Categorical) or simple lists. :type parameter_space: Union[Dict[str, Any], List[Dict[str, Any]]] :param steps: The granularity for discretizing continuous parameters (`Real`). Defaults to 10. :type steps: int, optional :returns: The approximate total number of parameter combinations. :rtype: int :raises ValueError: If `parameter_space` is not a dict or a list of dicts.