mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-14 05:14:19 +00:00
tcn metrics
This commit is contained in:
@@ -37,6 +37,7 @@ def get_tcn_data(
|
||||
model_save_name: str = "tcn_model",
|
||||
force_reset: bool = True,
|
||||
save_checkpoints: bool = True,
|
||||
metric: str = "mape",
|
||||
) -> Tuple[
|
||||
List[Optional[TimeSeries]],
|
||||
List[Optional[TimeSeries]],
|
||||
@@ -86,6 +87,8 @@ def get_tcn_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
|
||||
-------
|
||||
@@ -166,4 +169,5 @@ def get_tcn_data(
|
||||
train_split,
|
||||
forecast_horizon,
|
||||
n_predict,
|
||||
metric,
|
||||
)
|
||||
|
||||
@@ -44,6 +44,7 @@ def display_tcn_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 TCN forecast
|
||||
@@ -104,6 +105,10 @@ def display_tcn_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 predicted values. 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
|
||||
"""
|
||||
@@ -141,6 +146,7 @@ def display_tcn_forecast(
|
||||
model_save_name=model_save_name,
|
||||
force_reset=force_reset,
|
||||
save_checkpoints=save_checkpoints,
|
||||
metric=metric,
|
||||
)
|
||||
if ticker_series == []:
|
||||
return
|
||||
@@ -165,6 +171,7 @@ def display_tcn_forecast(
|
||||
naive=naive,
|
||||
export_pred_raw=export_pred_raw,
|
||||
external_axes=external_axes,
|
||||
metric=metric,
|
||||
)
|
||||
if residuals:
|
||||
helpers.plot_residuals(
|
||||
|
||||
Reference in New Issue
Block a user