pywatts.modules.models package¶
Submodules¶
pywatts.modules.models.profile_neural_network module¶
-
class
pywatts.modules.models.profile_neural_network.ProfileNeuralNetwork(name: str = 'PNN', epochs=50, offset=0, batch_size=128, validation_split=0.2)¶ Bases:
pywatts.core.base.BaseEstimatorThis module implements the profile neural network. It is a model for forecasting short-term electrical load. Therefore, it takes into account, trend information, calendar_information, historical input but also the profile of the load. Note the horizon is extracted from the data If you use it please cite:
Benedikt Heidrich, Marian Turowski, Nicole Ludwig, Ralf Mikut, and Veit Hagenmeyer. 2020. Forecasting energy time series with profile neural networks. In Proceedings of the Eleventh ACM International Conference on Future Energy Systems (e-Energy ’20). Association for Computing Machinery, New York, NY, USA, 220–230. DOI:https://doi.org/10.1145/3396851.3397683Parameters: - name (str) – The name of the module
- epochs (int) – The number of epochs the model should be trained.
- offset (int) – The number of samples at the beginning of the dataset that should be not considered for training.
- batch_size (int) – The batch size which should be used for training
- validation_split (float) – The share of data which should be used for validation
-
fit(historical_input, calendar, temperature, humidity, profile, trend, target)¶ Fit the Profile Neural Network.
Parameters: - historical_input (xr.DataArray) – The historical input
- calendar (xr.DataArray) – The calendar information of the dates that should be predicted.
- temperature (xr.DataArray) – The temperature of the dates that should be predicted
- humidity (xr.DataArray) – The humidity of the dates that should be predicted
- profile (xr.DataArray) – The profile of the dates that should be predicted
- trend (xr.DataArray) – The trend information of the dates that should be predicted
- target (xr.DataArray) – The ground truth of the desired prediction
-
get_params() → Dict[str, object]¶ Get parameter for this object as dict.
Returns: Object parameters as json dict
-
classmethod
load(load_information) → pywatts.core.base.BaseEstimator¶ Load the PNN model.
Parameters: params – The paramters which should be used for restoring the PNN. Returns: A wrapped keras model.
-
save(fm: pywatts.core.filemanager.FileManager) → Dict[KT, VT]¶ Stores the PNN at the given path
Parameters: fm – The Filemanager, which contains the path where the model should be stored Returns: The path where the model is stored.
-
set_params(epochs=None, offset=None, batch_size=None, validation_split=None)¶ Parameters: - epochs (int) – The number of epochs the model should be trained.
- offset (int) – The number of samples at the beginning of the dataset that should be not considered for training.
- batch_size (int) – The batch size which should be used for training
- validation_split (float) – The share of data which should be used for validation
-
transform(historical_input, calendar, temperature, humidity, profile, trend) → xarray.core.dataarray.DataArray¶ Forecast the electrical load for the given input.
Parameters: - historical_input (xr.DataArray) – The historical input
- calendar (xr.DataArray) – The calendar information of the dates that should be predicted.
- temperature (xr.DataArray) – The temperature of the dates that should be predicted
- humidity (xr.DataArray) – The humidity of the dates that should be predicted
- profile (xr.DataArray) – The profile of the dates that should be predicted
- trend (xr.DataArray) – The trend information of the dates that should be predicted
Returns: The prediction
Return type: xr.DataArray