Ver Fonte

awg commit algorithm components

anweiguo há 4 meses atrás
pai
commit
7ee99ab777

+ 3 - 0
models_processing/model_predict/model_prediction_lightgbm.py

@@ -54,6 +54,9 @@ def forecast_data_distribution(pre_data,args):
             else:
                 df['power_forecast'] = model.predict(df[model.feature_name()])
                 df.loc[df['power_forecast'] < 0, 'power_forecast'] = 0
+                # 添加小时列 把光夜间置为0
+                df["hour"] = pd.to_datetime(df["date_time"]).dt.hour
+                df.loc[(df["hour"] >= 20) | (df["hour"] < 6), 'power_forecast'] = 0
                 print("model predict result  successfully!")
                 result = df[['farm_id', 'date_time', 'power_forecast']]
         else: