|
@@ -63,7 +63,7 @@ def forecast_data_distribution(pre_data,args):
|
|
|
def model_prediction(df,args):
|
|
|
if 'is_limit' in df.columns:
|
|
|
df = df[df['is_limit'] == False]
|
|
|
- features, time_steps, col_time, model_name,howLongAgo,farm_id = str_to_list(args['features']), int(args['time_steps']),args['col_time'],args['model_name'],int(args['howLongAgo']),args['farm_id']
|
|
|
+ features, time_steps, col_time, model_name,howLongAgo,farm_id,target = str_to_list(args['features']), int(args['time_steps']),args['col_time'],args['model_name'],int(args['howLongAgo']),args['farm_id'],args['target']
|
|
|
feature_scaler,target_scaler = get_scaler_model_from_mongo(args)
|
|
|
df = df.sort_values(by=col_time).fillna(method='ffill').fillna(method='bfill')
|
|
|
scaled_features = feature_scaler.transform(df[features])
|
|
@@ -78,7 +78,7 @@ def model_prediction(df,args):
|
|
|
result['howLongAgo'] = howLongAgo
|
|
|
result['farm_id'] = farm_id
|
|
|
result['model'] = model_name
|
|
|
- return result[['dateTime', 'howLongAgo', 'model', 'farm_id', 'power_forecast', 'realPower']]
|
|
|
+ return result[['dateTime', 'howLongAgo', 'model', 'farm_id', 'power_forecast', target]]
|
|
|
|
|
|
|
|
|
@app.route('/model_prediction_lstm', methods=['POST'])
|