Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -994,6 +994,10 @@ def advanced_xgboost_predict(predict_days=5):
|
|
| 994 |
input_df = pd.DataFrame([features_list], columns=feature_names)
|
| 995 |
|
| 996 |
print(f"特徵向量: {[f'{f:.4f}' for f in features_list[:5]]}...") # 只顯示前5個
|
|
|
|
|
|
|
|
|
|
|
|
|
| 997 |
|
| 998 |
# 進行預測
|
| 999 |
predictions = xgb_model.predict('xgboost_model', input_df)
|
|
@@ -1031,6 +1035,11 @@ def advanced_xgboost_predict(predict_days=5):
|
|
| 1031 |
traceback.print_exc()
|
| 1032 |
return None
|
| 1033 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1034 |
def clear_old_cache():
|
| 1035 |
"""清理過期的緩存數據"""
|
| 1036 |
current_time = time.time()
|
|
|
|
| 994 |
input_df = pd.DataFrame([features_list], columns=feature_names)
|
| 995 |
|
| 996 |
print(f"特徵向量: {[f'{f:.4f}' for f in features_list[:5]]}...") # 只顯示前5個
|
| 997 |
+
# 🔍 新增這段:完整印出本次預測輸入資料
|
| 998 |
+
print("\n=== 📊 本次預測輸入特徵 DataFrame ===")
|
| 999 |
+
print(input_df)
|
| 1000 |
+
print("=== ✅ 檢查以上特徵是否每次都有變 ===\n")
|
| 1001 |
|
| 1002 |
# 進行預測
|
| 1003 |
predictions = xgb_model.predict('xgboost_model', input_df)
|
|
|
|
| 1035 |
traceback.print_exc()
|
| 1036 |
return None
|
| 1037 |
|
| 1038 |
+
|
| 1039 |
+
|
| 1040 |
+
# 呼叫模型預測
|
| 1041 |
+
predictions = model.predict('xgboost_model', input_df)
|
| 1042 |
+
|
| 1043 |
def clear_old_cache():
|
| 1044 |
"""清理過期的緩存數據"""
|
| 1045 |
current_time = time.time()
|