aromidvar commited on
Commit
7814b87
·
verified ·
1 Parent(s): 84a8fa1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -79,7 +79,10 @@ def run_dashboard(data_src, ticker, file_upload, timeframe, start_date, end_date
79
  df = add_sentiment(df, ticker, news_api_key, start_date, end_date)
80
 
81
  progress(0.6, "Training model...")
82
- features = ['Open', 'High', 'Low', 'value', 'Volume'] + list(indicators) + (['sentiment'] if include_sentiment else [])
 
 
 
83
  result = get_model(
84
  df=df,
85
  features=features,
 
79
  df = add_sentiment(df, ticker, news_api_key, start_date, end_date)
80
 
81
  progress(0.6, "Training model...")
82
+ candidate_features = ['Open', 'High', 'Low', 'value', 'Volume'] + list(indicators) + (['sentiment'] if include_sentiment else [])
83
+ features = [c for c in candidate_features if c in df.columns]
84
+ if 'value' not in features:
85
+ raise ValueError("'value' column missing after loading data. Check data source and dates.")
86
  result = get_model(
87
  df=df,
88
  features=features,