mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-02 15:32:04 +00:00
linregr metrics
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user