commonpower.data_forecasting.nn_forecasting.transform.SklearnScalerTransform

class SklearnScalerTransform(scaler: Any)[source]

Bases: Transformation

Transformation based on a sklearn scaler. We need the given scaler to implement fit(), transform() and inverse_transform() methods. Caution regarding the state_dict() and load_state_dict() methods: Some exotic scalers might need a custom implementation. :param scaler: Instance of sklearn scaler. :type scaler: Any, optional

Methods

fit

Fit the transformation to the data.

from_checkpoint

inverse

Inverse transform the data.

load_state_dict

Load the state of the transformation.

state_dict

Return the state of the transformation.

__call__(data: ndarray) ndarray[source]

Transform the data.

fit(data: ndarray)[source]

Fit the transformation to the data.

inverse(data: ndarray) ndarray[source]

Inverse transform the data.

load_state_dict(state_dict: dict) None[source]

Load the state of the transformation.

state_dict() dict[source]

Return the state of the transformation.