Spaces:
Running
Running
tbdavid2019
commited on
Commit
•
a8d3b4f
1
Parent(s):
ea4fe6a
bug fix
Browse files
app.py
CHANGED
@@ -149,7 +149,7 @@ def get_top_10_potential_stocks(period, selected_indices):
|
|
149 |
predicted_prices = predict_stock(model, data, scaler, time_step=time_step)
|
150 |
|
151 |
# Calculate the potential (e.g., last predicted price vs last actual price)
|
152 |
-
potential = (predicted_prices[-1] - data['Close'].values[-1]) / data['Close'].values[-1]
|
153 |
stock_predictions.append((ticker, potential, data['Close'].values[-1], predicted_prices[-1][0]))
|
154 |
except Exception as e:
|
155 |
print(f"股票 {ticker} 發生錯誤: {str(e)}")
|
|
|
149 |
predicted_prices = predict_stock(model, data, scaler, time_step=time_step)
|
150 |
|
151 |
# Calculate the potential (e.g., last predicted price vs last actual price)
|
152 |
+
potential = (predicted_prices[-1][0] - data['Close'].values[-1]) / data['Close'].values[-1]
|
153 |
stock_predictions.append((ticker, potential, data['Close'].values[-1], predicted_prices[-1][0]))
|
154 |
except Exception as e:
|
155 |
print(f"股票 {ticker} 發生錯誤: {str(e)}")
|