mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-12 20:31:18 +00:00
rnn metric
This commit is contained in:
@@ -36,6 +36,7 @@ def get_rnn_data(
|
||||
input_chunk_size: int = 14,
|
||||
force_reset: bool = True,
|
||||
save_checkpoints: bool = True,
|
||||
metric: str = "mape",
|
||||
) -> Tuple[
|
||||
Optional[List[type[TimeSeries]]],
|
||||
Optional[List[type[TimeSeries]]],
|
||||
@@ -77,6 +78,8 @@ def get_rnn_data(
|
||||
save_checkpoints: bool
|
||||
Whether or not to automatically save the untrained model and checkpoints from training.
|
||||
Defaults to True.
|
||||
metric: str
|
||||
Metric to use for model selection. Defaults to "mape".
|
||||
|
||||
Returns
|
||||
-------
|
||||
@@ -145,4 +148,5 @@ def get_rnn_data(
|
||||
train_split,
|
||||
forecast_horizon,
|
||||
n_predict,
|
||||
metric,
|
||||
)
|
||||
|
||||
@@ -42,6 +42,7 @@ def display_rnn_forecast(
|
||||
end_date: Optional[datetime] = None,
|
||||
naive: bool = False,
|
||||
export_pred_raw: bool = False,
|
||||
metric: str = "mape",
|
||||
external_axes: Optional[List[plt.axes]] = None,
|
||||
):
|
||||
"""Display RNN forecast
|
||||
@@ -94,6 +95,10 @@ def display_rnn_forecast(
|
||||
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.
|
||||
export_pred_raw: bool
|
||||
Whether to export the raw predictions. Defaults to False.
|
||||
metric: str
|
||||
The metric to use for the forecast. Defaults to "mape".
|
||||
external_axes: Optional[List[plt.axes]]
|
||||
External axes to plot on
|
||||
"""
|
||||
@@ -124,6 +129,7 @@ def display_rnn_forecast(
|
||||
input_chunk_size=input_chunk_size,
|
||||
force_reset=force_reset,
|
||||
save_checkpoints=save_checkpoints,
|
||||
metric=metric,
|
||||
)
|
||||
if ticker_series == []:
|
||||
return
|
||||
@@ -148,6 +154,7 @@ def display_rnn_forecast(
|
||||
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