diff --git a/README.md b/README.md index 84ee821..1dc1906 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,10 @@ POST 947.7765892741911, 888.8596446324813 ], + "co2": [ + 188.88, + 256.99 + ] "vocs": [ 1023.5987164161264, 959.9684162030799 diff --git a/models/lgb_predict.py b/models/lgb_predict.py index 24cbfd5..d20df7a 100644 --- a/models/lgb_predict.py +++ b/models/lgb_predict.py @@ -114,7 +114,7 @@ def predict_df(his_data, input_data:pd.DataFrame, model:lgb.Booster, object_cols input_data_cp['pm10'] = input_data.apply(lambda x: cal_PM(x['0_c_smoke'], x['生产设备类型'], emission_factors.get('pm10')), axis=1) assert 'coal' in input_data_cp.columns input_data_cp['co2'] = input_data_cp.apply(lambda x: cal_CO2(x['coal'], x['低位发热量']), axis=1) - out_cols = ['company', 'unit', 'time', 'coal', 'co', 'vocs', 'pm25', 'pm10'] + out_cols = ['company', 'unit', 'time', 'coal', 'co', 'vocs', 'co2', 'pm25', 'pm10'] rst = input_data_cp[out_cols].to_dict(orient='list') return rst