Scaler¶
- class baybe.scaler.Scaler[source]¶
Bases:
ABC
Abstract base class for all scalers.
- Parameters:
searchspace (
DataFrame
) – The search space that should be scaled.
Public methods
__init__
(searchspace)fit_transform
(x, y)Fit the scaler using the given training data and transform the data.
transform
(x)Scale a given input.
untransform
(mean, variance)Transform mean values and variances back to the original domain.
Public attributes and properties
Class variable for all subclasses
Class variable encoding the type of the scaler.
- abstract fit_transform(x: Tensor, y: Tensor)[source]¶
Fit the scaler using the given training data and transform the data.
- transform(x: Tensor)[source]¶
Scale a given input.
- Parameters:
x (
Tensor
) – The given input.- Return type:
- Returns:
The scaled input.
- Raises:
RuntimeError – If the scaler is not fitted first.
- untransform(mean: Tensor, variance: Tensor)[source]¶
Transform mean values and variances back to the original domain.