Skip to content

exceptions¶

skforecast.exceptions.exceptions.set_warnings_style ¶

set_warnings_style(style='skforecast')

Set the warning handler based on the provided style.

Parameters:

Name Type Description Default
style str

The style of the warning handler. Either 'skforecast' or 'default'.

'skforecast'

Returns:

Type Description
None
Source code in skforecast\exceptions\exceptions.py
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
def set_warnings_style(style: str = 'skforecast') -> None:
    """
    Set the warning handler based on the provided style.

    Parameters
    ----------
    style : str, default='skforecast'
        The style of the warning handler. Either 'skforecast' or 'default'.

    Returns
    -------
    None

    """
    if style == "skforecast":
        if not hasattr(warnings, "_original_showwarning"):
            warnings._original_showwarning = warnings.showwarning
        warnings.showwarning = rich_warning_handler
    else:
        warnings.showwarning = warnings._original_showwarning

skforecast.exceptions.exceptions.DataTypeWarning ¶

DataTypeWarning(message)

Bases: UserWarning

Warning used to notify there are dtypes in the exogenous data that are not 'int', 'float', 'bool' or 'category'. Most machine learning models do not accept other data types, therefore the forecaster fit and predict may fail.

Attributes:

Name Type Description
message
Source code in skforecast\exceptions\exceptions.py
108
109
def __init__(self, message):
    self.message = message

Attributes¶

message instance-attribute ¶

message = message

skforecast.exceptions.exceptions.DataTransformationWarning ¶

DataTransformationWarning(message)

Bases: UserWarning

Warning used to notify that the output data is in the transformed space.

Attributes:

Name Type Description
message
Source code in skforecast\exceptions\exceptions.py
123
124
def __init__(self, message):
    self.message = message

Attributes¶

message instance-attribute ¶

message = message

skforecast.exceptions.exceptions.ExogenousInterpretationWarning ¶

ExogenousInterpretationWarning(message)

Bases: UserWarning

Warning used to notify about important implications when using exogenous variables with models that use a two-step approach (e.g., regression + ARAR).

Attributes:

Name Type Description
message
Source code in skforecast\exceptions\exceptions.py
139
140
def __init__(self, message):
    self.message = message

Attributes¶

message instance-attribute ¶

message = message

skforecast.exceptions.exceptions.FeatureOutOfRangeWarning ¶

FeatureOutOfRangeWarning(message)

Bases: UserWarning

Warning used to notify that a feature is out of the range seen during training.

Attributes:

Name Type Description
message
Source code in skforecast\exceptions\exceptions.py
154
155
def __init__(self, message):
    self.message = message

Attributes¶

message instance-attribute ¶

message = message

skforecast.exceptions.exceptions.IgnoredArgumentWarning ¶

IgnoredArgumentWarning(message)

Bases: UserWarning

Warning used to notify that an argument is ignored when using a method or a function.

Attributes:

Name Type Description
message
Source code in skforecast\exceptions\exceptions.py
170
171
def __init__(self, message):
    self.message = message

Attributes¶

message instance-attribute ¶

message = message

skforecast.exceptions.exceptions.InputTypeWarning ¶

InputTypeWarning(message)

Bases: UserWarning

Warning used to notify that input format is not the most efficient or recommended for the forecaster.

Attributes:

Name Type Description
message
Source code in skforecast\exceptions\exceptions.py
186
187
def __init__(self, message):
    self.message = message

Attributes¶

message instance-attribute ¶

message = message

skforecast.exceptions.exceptions.LongTrainingWarning ¶

LongTrainingWarning(message)

Bases: UserWarning

Warning used to notify that a large number of models will be trained and the the process may take a while to run.

Attributes:

Name Type Description
message
Source code in skforecast\exceptions\exceptions.py
202
203
def __init__(self, message):
    self.message = message

Attributes¶

message instance-attribute ¶

message = message

skforecast.exceptions.exceptions.MissingExogWarning ¶

MissingExogWarning(message)

Bases: UserWarning

Warning used to indicate that there are missing exogenous variables in the data. Most machine learning models do not accept missing values, so the Forecaster's fit' andpredict' methods may fail.

Attributes:

Name Type Description
message
Source code in skforecast\exceptions\exceptions.py
219
220
def __init__(self, message):
    self.message = message

Attributes¶

message instance-attribute ¶

message = message

skforecast.exceptions.exceptions.MissingValuesWarning ¶

MissingValuesWarning(message)

Bases: UserWarning

Warning used to indicate that there are missing values in the data. This warning occurs when the input data contains missing values, or the training matrix generates missing values. Most machine learning models do not accept missing values, so the Forecaster's fit' andpredict' methods may fail.

Attributes:

Name Type Description
message
Source code in skforecast\exceptions\exceptions.py
237
238
def __init__(self, message):
    self.message = message

Attributes¶

message instance-attribute ¶

message = message

skforecast.exceptions.exceptions.OneStepAheadValidationWarning ¶

OneStepAheadValidationWarning(message)

Bases: UserWarning

Warning used to notify that the one-step-ahead validation is being used.

Attributes:

Name Type Description
message
Source code in skforecast\exceptions\exceptions.py
252
253
def __init__(self, message):
    self.message = message

Attributes¶

message instance-attribute ¶

message = message

skforecast.exceptions.exceptions.ResidualsUsageWarning ¶

ResidualsUsageWarning(message)

Bases: UserWarning

Warning used to notify that a residual are not correctly used in the probabilistic forecasting process.

Attributes:

Name Type Description
message
Source code in skforecast\exceptions\exceptions.py
268
269
def __init__(self, message):
    self.message = message

Attributes¶

message instance-attribute ¶

message = message

skforecast.exceptions.exceptions.UnknownLevelWarning ¶

UnknownLevelWarning(message)

Bases: UserWarning

Warning used to notify that a level being predicted was not part of the training data.

Attributes:

Name Type Description
message
Source code in skforecast\exceptions\exceptions.py
284
285
def __init__(self, message):
    self.message = message

Attributes¶

message instance-attribute ¶

message = message

skforecast.exceptions.exceptions.SaveLoadSkforecastWarning ¶

SaveLoadSkforecastWarning(message)

Bases: UserWarning

Warning used to notify any issues that may arise when saving or loading a forecaster.

Attributes:

Name Type Description
message
Source code in skforecast\exceptions\exceptions.py
300
301
def __init__(self, message):
    self.message = message

Attributes¶

message instance-attribute ¶

message = message

skforecast.exceptions.exceptions.SkforecastVersionWarning ¶

SkforecastVersionWarning(message)

Bases: UserWarning

Warning used to notify that the skforecast version installed in the environment differs from the version used to initialize the forecaster.

Attributes:

Name Type Description
message
Source code in skforecast\exceptions\exceptions.py
316
317
def __init__(self, message):
    self.message = message

Attributes¶

message instance-attribute ¶

message = message