kingabzpro commited on
Commit
3605d86
1 Parent(s): e93c4f1

Sync App files

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -153,6 +153,12 @@ class StockPredictor:
153
  last_values["month"] = date.month
154
  last_values["day"] = date.day
155
 
 
 
 
 
 
 
156
  # Ensure input features are in the correct format
157
  prediction_input = pd.DataFrame([last_values], columns=features)
158
  prediction = model.predict(prediction_input)[0]
 
153
  last_values["month"] = date.month
154
  last_values["day"] = date.day
155
 
156
+ # Update the lag features
157
+ if len(last_5_close) >= 5:
158
+ last_values["lag_5"] = last_5_close[-5]
159
+ if len(last_10_close) >= 10:
160
+ last_values["lag_10"] = last_10_close[-10]
161
+
162
  # Ensure input features are in the correct format
163
  prediction_input = pd.DataFrame([last_values], columns=features)
164
  prediction = model.predict(prediction_input)[0]