diff options
author | James Maslek <jmaslek11@gmail.com> | 2023-08-08 13:37:20 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-08 13:37:20 -0400 |
commit | ed78b5e49407e1c4988af799baf228ae961f8b55 (patch) | |
tree | baa09deca71d99ecb0168bf2d58574d5760201d3 | |
parent | 32f1b79f1a585acfcb387f8b4c9a87d26e0cd839 (diff) | |
parent | 74a7fcb41600bd0d5e47436c131e036fb86047e0 (diff) |
Merge branch 'develop' into release/3.2.1
-rw-r--r-- | openbb_terminal/common/behavioural_analysis/reddit_view.py | 4 | ||||
-rw-r--r-- | openbb_terminal/fixedincome/fred_view.py | 4 | ||||
-rw-r--r-- | openbb_terminal/forecast/brnn_view.py | 127 | ||||
-rw-r--r-- | openbb_terminal/forecast/expo_view.py | 97 |
4 files changed, 111 insertions, 121 deletions
diff --git a/openbb_terminal/common/behavioural_analysis/reddit_view.py b/openbb_terminal/common/behavioural_analysis/reddit_view.py index 8fc49af7506..2855c5349cc 100644 --- a/openbb_terminal/common/behavioural_analysis/reddit_view.py +++ b/openbb_terminal/common/behavioural_analysis/reddit_view.py @@ -282,8 +282,8 @@ def display_redditsent( Optionally specify the name of the sheet the data is exported to. export: str Format to export data - external_axes: Optional[List[plt.Axes]] - If supplied, expect 1 external axis + external_axes : bool, optional + Whether to return the figure object or not, by default False """ fig = OpenBBFigure() diff --git a/openbb_terminal/fixedincome/fred_view.py b/openbb_terminal/fixedincome/fred_view.py index 97b279c0128..b5ba7cb9b0a 100644 --- a/openbb_terminal/fixedincome/fred_view.py +++ b/openbb_terminal/fixedincome/fred_view.py @@ -975,8 +975,8 @@ def display_yield_curve( ---------- date: str Date to get curve for. If None, gets most recent date (format yyyy-mm-dd) - external_axes : Optional[List[plt.Axes]], optional - External axes (1 axis is expected in the list), by default None + external_axes : bool, optional + Whether to return the figure object or not, by default False raw : bool Output only raw data export : str diff --git a/openbb_terminal/forecast/brnn_view.py b/openbb_terminal/forecast/brnn_view.py index 9fcf49e5428..b59c06abefc 100644 --- a/openbb_terminal/forecast/brnn_view.py +++ b/openbb_terminal/forecast/brnn_view.py @@ -48,72 +48,67 @@ def display_brnn_forecast( ) -> Union[OpenBBFigure, None]: """Display BRNN forecast - Parameters - ---------- - data: Union[pd.Series, pd.DataFrame] - Input Data - target_column: str - Target column to forecast. Defaults to "close". - dataset_name: str - The name of the ticker to be predicted - n_predict: int - Days to predict. Defaults to 5. - train_split: float - Train/val split. Defaults to 0.85. - past_covariates: str - Multiple secondary columns to factor in when forecasting. Defaults to None. - forecast_horizon: int - Forecast horizon when performing historical forecasting. Defaults to 5. - input_chunk_length: int - Number of past time steps that are fed to the forecasting module at prediction time. Defaults to 14. - output_chunk_length: int - The length of the forecast of the model. Defaults to 5. - model_type: str - Either a string specifying the RNN module type ("RNN", "LSTM" or "GRU"). Defaults to "LSTM". - n_rnn_layers: int - Number of layers in the RNN module. Defaults to 1. - dropout: float - Fraction of neurons affected by Dropout. Defaults to 0.0. - batch_size: int - Number of time series (input and output sequences) used in each training pass. Defaults to 32. - n_epochs: int - Number of epochs over which to train the model. Defaults to 101. - learning_rate: float - Defaults to 1e-3. - model_save_name: str - Name for model. Defaults to "brnn_model". - force_reset: bool - If set to True, any previously-existing model with the same name will be reset - (all checkpoints will be discarded). Defaults to True. - save_checkpoints: bool - Whether or not to automatically save the untrained model and checkpoints from training. - Defaults to True. - sheet_name: str - Optionally specify the name of the sheet the data is exported to. - export: str - Format to export data - residuals: bool - Whether to show residuals for the model. Defaults to False. - forecast_only: bool - Whether to only show dates in the forecasting range. Defaults to False. - start_date: Optional[datetime] - The starting date to perform analysis, data before this is trimmed. Defaults to None. - end_date: Optional[datetime] - The ending date to perform analysis, data after this is trimmed. Defaults to None. - 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. - <<<<<<< HEAD - external_axes : bool, optional - Whether to return the figure object or not, by default 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 - >>>>>>> OpenBBTerminal-main + Parameters + ---------- + data: Union[pd.Series, pd.DataFrame] + Input Data + target_column: str + Target column to forecast. Defaults to "close". + dataset_name: str + The name of the ticker to be predicted + n_predict: int + Days to predict. Defaults to 5. + train_split: float + Train/val split. Defaults to 0.85. + past_covariates: str + Multiple secondary columns to factor in when forecasting. Defaults to None. + forecast_horizon: int + Forecast horizon when performing historical forecasting. Defaults to 5. + input_chunk_length: int + Number of past time steps that are fed to the forecasting module at prediction time. Defaults to 14. + output_chunk_length: int + The length of the forecast of the model. Defaults to 5. + model_type: str + Either a string specifying the RNN module type ("RNN", "LSTM" or "GRU"). Defaults to "LSTM". + n_rnn_layers: int + Number of layers in the RNN module. Defaults to 1. + dropout: float + Fraction of neurons affected by Dropout. Defaults to 0.0. + batch_size: int + Number of time series (input and output sequences) used in each training pass. Defaults to 32. + n_epochs: int + Number of epochs over which to train the model. Defaults to 101. + learning_rate: float + Defaults to 1e-3. + model_save_name: str + Name for model. Defaults to "brnn_model". + force_reset: bool + If set to True, any previously-existing model with the same name will be reset + (all checkpoints will be discarded). Defaults to True. + save_checkpoints: bool + Whether or not to automatically save the untrained model and checkpoints from training. + Defaults to True. + sheet_name: str + Optionally specify the name of the sheet the data is exported to. + export: str + Format to export data + residuals: bool + Whether to show residuals for the model. Defaults to False. + forecast_only: bool + Whether to only show dates in the forecasting range. Defaults to False. + start_date: Optional[datetime] + The starting date to perform analysis, data before this is trimmed. Defaults to None. + end_date: Optional[datetime] + The ending date to perform analysis, data after this is trimmed. Defaults to None. + 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 : bool, optional + Whether to return the figure object or not, by default False """ data = helpers.clean_data( data, start_date, end_date, target_column, past_covariates diff --git a/openbb_terminal/forecast/expo_view.py b/openbb_terminal/forecast/expo_view.py index 7231cd76aed..ab6d82b30b4 100644 --- a/openbb_terminal/forecast/expo_view.py +++ b/openbb_terminal/forecast/expo_view.py @@ -41,57 +41,52 @@ def display_expo_forecast( ) -> Union[OpenBBFigure, None]: """Display Probabilistic Exponential Smoothing forecast - Parameters - ---------- - data : Union[pd.Series, np.array] - Data to forecast - dataset_name: str - The name of the ticker to be predicted - target_column: Optional[str]: - Target column to forecast. Defaults to "close". - trend: str - Trend component. One of [N, A, M] - Defaults to ADDITIVE. - seasonal: str - Seasonal component. One of [N, A, M] - Defaults to ADDITIVE. - seasonal_periods: int - Number of seasonal periods in a year - If not set, inferred from frequency of the series. - dampen: str - Dampen the function - n_predict: int - Number of days to forecast - start_window: float - Size of sliding window from start of timeseries and onwards - forecast_horizon: int - Number of days to forecast when backtesting and retraining historical - sheet_name: str - Optionally specify the name of the sheet the data is exported to. - export: str - Format to export data - residuals: bool - Whether to show residuals for the model. Defaults to False. - forecast_only: bool - Whether to only show dates in the forecasting range. Defaults to False. - start_date: Optional[datetime] - The starting date to perform analysis, data before this is trimmed. Defaults to None. - end_date: Optional[datetime] - The ending date to perform analysis, data after this is trimmed. Defaults to None. - 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. - <<<<<<< HEAD - external_axes : bool, optional - Whether to return the figure object or not, by default False - ======= - export_pred_raw: bool - Whether to export the raw predicted values. Defaults to False. - metric: str - The metric to use when backtesting. Defaults to "mape". - external_axes: Optional[List[plt.axes]] - External axes to plot on - >>>>>>> OpenBBTerminal-main + Parameters + ---------- + data : Union[pd.Series, np.array] + Data to forecast + dataset_name: str + The name of the ticker to be predicted + target_column: Optional[str]: + Target column to forecast. Defaults to "close". + trend: str + Trend component. One of [N, A, M] + Defaults to ADDITIVE. + seasonal: str + Seasonal component. One of [N, A, M] + Defaults to ADDITIVE. + seasonal_periods: int + Number of seasonal periods in a year + If not set, inferred from frequency of the series. + dampen: str + Dampen the function + n_predict: int + Number of days to forecast + start_window: float + Size of sliding window from start of timeseries and onwards + forecast_horizon: int + Number of days to forecast when backtesting and retraining historical + sheet_name: str + Optionally specify the name of the sheet the data is exported to. + export: str + Format to export data + residuals: bool + Whether to show residuals for the model. Defaults to False. + forecast_only: bool + Whether to only show dates in the forecasting range. Defaults to False. + start_date: Optional[datetime] + The starting date to perform analysis, data before this is trimmed. Defaults to None. + end_date: Optional[datetime] + The ending date to perform analysis, data after this is trimmed. Defaults to None. + 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 when backtesting. Defaults to "mape". + external_axes : bool, optional + Whether to return the figure object or not, by default False """ data = helpers.clean_data(data, start_date, end_date, target_column, None) if not helpers.check_data(data, target_column, None): |