linregr metrics

This commit is contained in:
martinb-bb
2023-02-08 14:14:59 -05:00
parent b47fcc8789
commit 477e4271db
2 changed files with 13 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ def get_linear_regression_data(
output_chunk_length: int = 5,
lags: Union[int, List[int]] = 14,
random_state: Optional[int] = None,
metric: str = "mape",
) -> Tuple[
List[TimeSeries],
List[TimeSeries],
@@ -56,6 +57,8 @@ def get_linear_regression_data(
lagged target values to predict the next time step
random_state: Optional[int]
The state for the model
metric: str
The metric to use for the model. Defaults to "mape".
Returns
-------
@@ -112,4 +115,5 @@ def get_linear_regression_data(
train_split,
forecast_horizon,
n_predict,
metric,
)

View File

@@ -35,6 +35,7 @@ def display_linear_regression(
naive: bool = False,
explainability_raw: bool = False,
export_pred_raw: bool = False,
metric: str = "mape",
external_axes: Optional[List[plt.axes]] = None,
):
"""Display Linear Regression Forecasting
@@ -74,6 +75,12 @@ def display_linear_regression(
naive: bool
Whether to show the naive baseline. This just assumes the closing price will be the
same as the previous day's closing price. Defaults to False.
explainability_raw: bool
Whether to show the raw explainability data. Defaults to False.
export_pred_raw: bool
Whether to export the raw prediction data. Defaults to False.
metric: str
The metric to use for the model. Defaults to "mape".
external_axes: Optional[List[plt.axes]]
External axes to plot on
"""
@@ -100,6 +107,7 @@ def display_linear_regression(
forecast_horizon=forecast_horizon,
output_chunk_length=output_chunk_length,
lags=lags,
metric=metric,
)
probabilistic = True
@@ -121,6 +129,7 @@ def display_linear_regression(
forecast_only=forecast_only,
naive=naive,
export_pred_raw=export_pred_raw,
metric=metric,
external_axes=external_axes,
)
if residuals: