autoemulate.core.tuner#
- class Tuner(x, y, n_iter=10, device=None, random_seed=None)[source]#
Bases:
ConversionMixin
,TorchDeviceMixin
Run randomised hyperparameter search for a given model.
- Parameters:
x (InputLike) – Input features.
y (OutputLike or None) – Target values (not needed if x is a Dataset).
n_iter (int) – Number of parameter settings to randomly sample and test.
device (DeviceLike | None) – The device to use for model training and evaluation. If None, uses the default device (usually CPU or GPU).
random_seed (int | None) – Random seed for reproducibility. If None, no seed is set.
- run(model_class, x_transforms=None, y_transforms=None, n_splits=5, seed=None, shuffle=True)[source]#
Run randomised hyperparameter search for a given model.
- Parameters:
model_class (type[Emulator]) – A concrete Emulator subclass.
x_transforms_list (list[list[AutoEmulateTransform]] | None) – An optional list of sequences of transforms to apply to the input data. Defaults to None, in which case the data is standardized.
y_transforms_list (list[list[AutoEmulateTransform]] | None) – An optional list of sequences of transforms to apply to the output data. Defaults to None, in which case the data is standardized.
n_splits (int) – Number of cross validation folds to split data into. Defaults to 5.
seed (int | None) – Random seed to use in cross validation. If None, no seed is set.
shuffle (bool) – Whether to shuffle data before splitting into cross validation folds. Defaults to True.
- Returns:
The validation scores and parameter values used in each search iteration.
- Return type: