pywatts.summaries package

Submodules

pywatts.summaries.mae_summary module

class pywatts.summaries.mae_summary.MAE(name: str = None, filter_method: Callable[[numpy.ndarray, numpy.ndarray], Tuple[numpy.ndarray, numpy.ndarray]] = None, offset: int = 0, cuts: List[Tuple[pandas._libs.tslibs.timestamps.Timestamp, pandas._libs.tslibs.timestamps.Timestamp]] = None)

Bases: pywatts.summaries.metric_base.MetricBase

Module to calculate the Mean Absolute Error (MAE)

Parameters:
  • offset (int) – Offset, which determines the number of ignored values in the beginning for calculating the MAE. Default 0
  • filter_method (Callable[[np.ndarray, np.ndarray], Tuple[np.ndarray, np.ndarray]]) – Filter which should performed on the data before calculating the MAE.

pywatts.summaries.mape_summary module

class pywatts.summaries.mape_summary.MAPE(name: str = None, filter_method: Callable[[numpy.ndarray, numpy.ndarray], Tuple[numpy.ndarray, numpy.ndarray]] = None, offset: int = 0, cuts: List[Tuple[pandas._libs.tslibs.timestamps.Timestamp, pandas._libs.tslibs.timestamps.Timestamp]] = None)

Bases: pywatts.summaries.metric_base.MetricBase

Module to calculate the Mean Absolute Percentage Error (MAPE)

Parameters:
  • offset (int) – Offset, which determines the number of ignored values in the beginning for calculating the MAPE. Default 0
  • filter_method (Callable[[np.ndarray, np.ndarray], Tuple[np.ndarray, np.ndarray]]) – Filter which should performed on the data before calculating the MAPE.

pywatts.summaries.mase_summary module

class pywatts.summaries.mase_summary.MASE(name: str = 'MASE', filter_method=None, offset: int = 0, cuts: Optional[List[Tuple[pandas._libs.tslibs.timestamps.Timestamp, pandas._libs.tslibs.timestamps.Timestamp]]] = None, lag: int = 1)

Bases: pywatts.summaries.metric_base.MetricBase

Module to calculate the Mean Absolute Scaled Error (MAPE)

Parameters:
  • offset (int) – Offset, which determines the number of ignored values in the beginning for calculating the MAPE. Default 0
  • filter_method (Callable[[np.ndarray, np.ndarray], Tuple[np.ndarray, np.ndarray]]) – Filter which should performed on the data before calculating the MAPE.
  • lag (int) – The lag determines the persistence forecast that is used for scaling the error.

pywatts.summaries.max_summary module

class pywatts.summaries.max_summary.MaxErr(name: str = None, filter_method: Callable[[numpy.ndarray, numpy.ndarray], Tuple[numpy.ndarray, numpy.ndarray]] = None, offset: int = 0, cuts: List[Tuple[pandas._libs.tslibs.timestamps.Timestamp, pandas._libs.tslibs.timestamps.Timestamp]] = None)

Bases: pywatts.summaries.metric_base.MetricBase

Module to calculate the maximal absolute error

Parameters:
  • offset (int) – Offset, which determines the number of ignored values in the beginning for calculating the max. Default 0
  • filter_method (Callable[[np.ndarray, np.ndarray], Tuple[np.ndarray, np.ndarray]]) – Filter which should performed on the data before calculating the max.

pywatts.summaries.metric_base module

class pywatts.summaries.metric_base.MetricBase(name: str = None, filter_method: Callable[[numpy.ndarray, numpy.ndarray], Tuple[numpy.ndarray, numpy.ndarray]] = None, offset: int = 0, cuts: List[Tuple[pandas._libs.tslibs.timestamps.Timestamp, pandas._libs.tslibs.timestamps.Timestamp]] = None)

Bases: pywatts.core.base_summary.BaseSummary, abc.ABC

Base Class for all Metrics

Parameters:
  • offset (int) – Offset, which determines the number of ignored values in the beginning for calculating the Metric. Default 0
  • filter_method (Callable[[np.ndarray, np.ndarray], Tuple[np.ndarray, np.ndarray]]) – Filter which should performed on the data before calculating the Metric.
get_params() → Dict[str, object]

Returns a dict of parameters used in the Metric.

Returns:Parameters set for the Metric
Return type:Dict[str, object]
classmethod load(load_information: Dict[KT, VT])

Uses the data in load_information for restoring the state of the module.

Parameters:load_information (Dict) – The data needed for restoring the state of the module
Returns:The restored module
Return type:Base
save(fm: pywatts.core.filemanager.FileManager) → Dict[KT, VT]

Saves the modules and the state of the module and returns a dictionary containing the relevant information.

Parameters:fm (FileManager) – the filemanager which can be used by the module for saving information about the module.
Returns:A dictionary containing the information needed for restoring the module
Return type:Dict
set_params(offset: Optional[int] = None, cuts=typing.Union[typing.List[typing.Tuple[pandas._libs.tslibs.timestamps.Timestamp, pandas._libs.tslibs.timestamps.Timestamp]], NoneType])

Set parameters of the Metric.

Parameters:
  • offset (int) – Offset, which determines the number of ignored values in the beginning for calculating the Metric.
  • cuts (List[Tuple[pd.Timestamp, pd.Timestamp]]) – The cutouts on which the metric should be additionally calculated.
transform(file_manager: pywatts.core.filemanager.FileManager, y: xarray.core.dataarray.DataArray, **kwargs) → pywatts.core.summary_object.SummaryObjectList

Calculates the MAE based on the predefined target and predictions variables. :param file_manager: The filemanager, it can be used to store data that corresponds to the summary as a file. :type: file_manager: FileManager :param y: the input dataset :type y: xr.DataArray :param kwargs: the predictions :type kwargs: xr.DataArray

Returns:The calculated MAE
Return type:xr.DataArray

pywatts.summaries.min_summary module

class pywatts.summaries.min_summary.MinErr(name: str = None, filter_method: Callable[[numpy.ndarray, numpy.ndarray], Tuple[numpy.ndarray, numpy.ndarray]] = None, offset: int = 0, cuts: List[Tuple[pandas._libs.tslibs.timestamps.Timestamp, pandas._libs.tslibs.timestamps.Timestamp]] = None)

Bases: pywatts.summaries.metric_base.MetricBase

Module to calculate the minimal absolute error

Parameters:
  • offset (int) – Offset, which determines the number of ignored values in the beginning for calculating the min. Default 0
  • filter_method (Callable[[np.ndarray, np.ndarray], Tuple[np.ndarray, np.ndarray]]) – Filter which should performed on the data before calculating the min.

pywatts.summaries.rmse_summary module

class pywatts.summaries.rmse_summary.RMSE(name: str = None, filter_method: Callable[[numpy.ndarray, numpy.ndarray], Tuple[numpy.ndarray, numpy.ndarray]] = None, offset: int = 0, cuts: List[Tuple[pandas._libs.tslibs.timestamps.Timestamp, pandas._libs.tslibs.timestamps.Timestamp]] = None)

Bases: pywatts.summaries.metric_base.MetricBase

Module to calculate the Root Mean Squared Error (RMSE)

Parameters:
  • offset (int) – Offset, which determines the number of ignored values in the beginning for calculating the RMSE. Default 0
  • filter_method (Callable[[np.ndarray, np.ndarray], Tuple[np.ndarray, np.ndarray]]) – Filter which should performed on the data before calculating the RMSE.

Module contents