sadiqgpasha / project_indianbanks_price_forecast

This project demonstrates that we programmatically download the bank stocks data and also forecast for a defined period of time and also display results on a streamlit UI
1 stars 0 forks source link

issue with forecasting streamline file #2

Open sadiqgpasha opened 1 month ago

sadiqgpasha commented 1 month ago

Error: KeyError: "['OPEN', 'HIGH', 'LOW', 'LTP', 'VWAP', '52W H', '52W L', 'VOLUME', 'VALUE', 'NO OF TRADES'] not in index"

sadiqgpasha commented 1 month ago

File "/Users/sadiqpasha/Downloads/project_indianbanks_price_forecast-main/forecasting_ui.py", line 94, in predictions = model.predict(h=h, new_df= valid) File "/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/mlforecast/forecast.py", line 710, in predict forecasts = ts.predict( File "/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/mlforecast/core.py", line 795, in predict preds = self._predict_multi( File "/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/mlforecast/core.py", line 675, in _predict_multi new_x = self._get_features_for_next_step(X_df) File "/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/mlforecast/core.py", line 596, in _get_features_for_next_step new_x = new_x[self.featuresorder] File "/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/pandas/core/frame.py", line 4108, in getitem indexer = self.columns._get_indexer_strict(key, "columns")[1] File "/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 6200, in _get_indexer_strict self._raise_if_missing(keyarr, indexer, axis_name) File "/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 6252, in _raise_if_missing raise KeyError(f"{not_found} not in index") KeyError: "['OPEN', 'HIGH', 'LOW', 'LTP', 'VWAP', '52W H', '52W L', 'VOLUME', 'VALUE', 'NO OF TRADES'] not in index"

sadiqgpasha commented 1 month ago

Issue has been resolved by modifying the code. All features are now part of index