hookeai.utilities.fit_data_scalers.mean_std_batch_fit¶
- mean_std_batch_fit(dataset, features_type, n_features, is_verbose=False)[source]¶
Perform batch fitting of standardization data scaler.
- Parameters:
dataset (torch.utils.data.Dataset) – Time series data set. Each sample is stored as a dictionary where each feature (key, str) data is a torch.Tensor(2d) of shape (sequence_length, n_features).
features_type (str) – Features for which data scaler is fitted (e.g., ‘features_in’, ‘features_out’). Must be directly available from data set samples.
n_features (int) – Number of features (dimensionality).
is_verbose (bool, default=False) – If True, enable verbose output.
- Returns:
mean (torch.Tensor) – Features standardization mean tensor stored as a torch.Tensor with shape (n_features,).
std (torch.Tensor) – Features standardization standard deviation tensor stored as a torch.Tensor with shape (n_features,).
Notes
A biased estimator is used to compute the standard deviation according with scikit-learn 1.3.2 documentation (sklearn.preprocessing.StandardScaler).