data package

Submodules

data.HDF5Reader module

data.TorchReader module

data.VTUReader module

data.dataset module

class data.dataset.BaseDataset[source]

Bases: Dataset

Base class for datasets.

property isscaled
process_data(process_function)[source]

Process the data using the provided function. The x and y attributes of the dataset are updated with the transformed data.

Parameters:

process_function (callable) – A function that takes in x and y as input and returns transformed x and y.

Return type:

None

rescale_data(rescale_x=True, rescale_y=True)[source]

Reverse the scaling of the data using the provided scalers. This function should be used only if the data has been scaled. The x and y attributes of the dataset are updated with the unscaled data.

Parameters:
  • rescale_x (bool) – Whether to unscale the input data (default: True).

  • rescale_y (bool) – Whether to unscale the target data (default: True).

Return type:

None

rescale_x(x)[source]

Rescale the input data using the scaler.

Parameters:

x (np.array) – The input data to be rescaled.

Returns:

The rescaled input data.

Return type:

np.array

rescale_y(y)[source]

Rescale the target data using the scaler.

Parameters:

y (np.array) – The target data to be rescaled.

Returns:

The rescaled target data.

Return type:

np.array

scale_data(scale_x=True, scale_y=True)[source]

Transform the data using the provided scalers. If the scalers are fitted, the data will be transformed. If not, the scalers will be fitted to the data and then the data will be transformed.

Parameters:
  • scale_x (bool) – Whether to scale the input data (default: True).

  • scale_y (bool) – Whether to scale the target data (default: True).

Return type:

None

Module contents