twinlab.ModelSelectionParams#

class twinlab.ModelSelectionParams(seed=None, evaluation_metric='MSLL', val_ratio=0.2, base_kernels='restricted', depth=1, beam=2)[source]#

Parameter configuration for the Bayesian model selection process.

Variables:
  • seed (Union[int, None], optional) – Specifies the seed for the random number generator for every trial of the model selection process. Setting to an integer is necessary for reproducible results. The default value is None, which means the seed is randomly generated each time.

  • evaluation_metric (str, optional) –

    Specifies the evaluation metric used to score different configuration during the model selection process. Can be either:

    • "MSLL": Mean squared log loss.

    • "BIC": Bayesian information criterion.

    The default is "MSLL".

  • val_ratio (float, optional) – Specifies the percentage of random validation data allocated to to compute the "BIC" metric. The default is 0.2.

  • base_kernels (Union[str, Set[str]], optional) –

    Specifies the set of individual kernels to use for compositional kernel search. Can be:

    • "all": The complete set of available kernels: {"LIN", "M12", "M32", "M52", "PER", "RBF", "RQF"}.

    • "restricted": The restricted set of kernels: {"LIN", "M32", "M52", "PER", "RBF"}.

    • A set of strings corresponding to the individual kernels to use for kernel selection, for example {"RBF", "PER"}.

    The default is “restricted”.

  • depth (int, optional) – Specifies the number of base kernels allowed to be combined in the compositional kernel search. For example, a depth=3 search means the resulting kernel may be composed from up-to three base kernels, so examples of allowed kernel combinations would be "(LIN+PER)*RBF" or "(M12*RBF)+RQF". The default value is 1, which simply compares all kernel functions individually. The maximum depth is 3.

__init__(seed=None, evaluation_metric='MSLL', val_ratio=0.2, base_kernels='restricted', depth=1, beam=2)[source]#

Methods

__init__([seed, evaluation_metric, ...])

unpack_parameters()