twinlab.EstimatorParams#

class twinlab.EstimatorParams(detrend=False, covar_module=None, kernel=None, estimator_type='single_task_gp')[source]#

Parameter configuration for the emulator.

Variables:
  • detrend (bool, optional) – Should the linear trend in the data be removed (detrended) before training the emulator? The defaults is False.

  • kernel (Union[str, None], optional) –

    Specifies the functions that build up the kernel (covariance matrix) of the Gaussian Process. Previously this argument was called covar_module, but this has been deprecated. The default is None, which means the library will use a default kernel, which is a scaled Matern 5/2. This can be chosen from a list of possible kernels:

    • "LIN": Linear.

    • "M12": Matern 1/2. A standard kernel for capturing data with a smooth trend

    • "M32": Matern 3/2. A standard kernel for capturing data with a smooth trend.

    • "M52": Matern 5/2. A standard kernel for capturing data with a smooth trend.

    • "PER": Periodic. Good for capturing data that has a periodic structure.

    • "RBF": Radial Basis Function. A standard kernel for capturing data with a smooth trend. A good default choice that can model smooth functions.

    • "RQF": Rational Quadratic Function.

    Kernels can also be composed by using combinations of the "+" (addative) and "*" (multiplicative) operators. For example, kernel = "(M52*PER)+RQF" is valid.

    Kernel Composition:

    The kernel parameter allows for the composition of different kernels to better capture complex systems where you have prior knowledge of trends in your data. Composition is achieved through the use of "+" and "*" operators, which represent additive and multiplicative compositions, respectively. Additive Composition ("+"): Combining kernels using the "+" operator allows the emulator to capture patterns that are present in the sum of the features represented by the individual kernels. For instance, if one kernel captures a linear trend and another captures periodicity, using "+" would enable the emulator to capture both linear and periodic trends in the data. Multiplicative Composition ("*"): The "*" operator combines kernels in a way that the resulting kernel captures interactions between the features represented by the individual kernels. This is useful for capturing complex patterns that arise from the interaction of simpler ones. For example, the kernel expression LIN*LIN would capture a quadratic trend in the data.

    Parentheses can be used to control the order of operations in kernel composition, similar to arithmetic expressions. It’s important to carefully consider the choice of kernels as improperly chosen kernels or compositions may lead to poor emulator performance.

  • estimator_type (str, optional) –

    Specifies the type of Gaussian process to use for the emulator. The default is "single_task_gp", but the value can be chosen from the following list:

    • "single_task_gp": The standard Gaussian Process, which learns a mean, covariance, and noise level.

    • "fixed_noise_gp": A Gaussian Process with fixed noise, which is specified by the user. Particularly useful for capturing noise-free simulated data where the noise can be set to zero manually.

    • "heteroskedastic_gp": A Gaussian Process with fixed noise that is allowed to vary with the input. The noise is specified by the user, and is also learned by the Process.

    • "variational_gp": An approximate Gaussian Process that is more efficient to train with large datasets.

    • "mixed_single_task_gp": A Gaussian Process that works with a mix of continuous and categorical or discrete input data.

    • "multi_fidelity_gp": A Gaussian Process that works with input data that has multiple levels of fidelity. For example, combined data from both a high- and low-resolution simulation. Use of this model requires setting the fidelity parameter in the TrainParams class.

    • "fixed_noise_multi_fidelity_gp": A Gaussian Process that works with input data that has multiple levels of fidelity and fixed noise.

    • "mixture_of_experts_gp": A Gaussian Process that trains multiple experts for different regions of the input space. This can improve the flexibility and adaptation of the overall function to the patterns of data in specific areas. Use of this requires setting the class_column parameter in the TrainParams class.

    • "classification_gp": A Gaussian Process model that is trained to classify data into two classes. Predictions from this model are binary, and the returned error is the class probability.

    • "zero_noise_gp": A Gaussian Process model that is trained with zero noise.

__init__(detrend=False, covar_module=None, kernel=None, estimator_type='single_task_gp')[source]#

Methods

__init__([detrend, covar_module, kernel, ...])

unpack_parameters()