Source code for tempor.methods.prediction.temporal.regression
"""Temporal regression estimators."""importabcfromtypingimportAnyimportpydanticfromtyping_extensionsimportSelfimporttempor.methods.coreasmethods_corefromtempor.coreimportplugins,pydantic_utilsfromtempor.dataimportdataset,samplesdefcheck_data_class(data:Any)->None:"""Check that the passed data is a temporal prediction dataset. Args: data (Any): The data to check. Raises: TypeError: If the data is not a temporal prediction dataset. """ifnotisinstance(data,dataset.TemporalPredictionDataset):raiseTypeError("Expected `data` passed to a temporal regression estimator to be "f"`{dataset.TemporalPredictionDataset.__name__}` but was {type(data)}")
[docs]classBaseTemporalRegressor(methods_core.BasePredictor):def__init__(self,**params:Any)->None:# pylint: disable=useless-super-delegation"""Base class for temporal regression estimators. Args: **params (Any): Parameters and defaults as defined in :class:`BasePredictorParams`. """super().__init__(**params)