Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
| 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,
|