magcheong commited on
Commit
8769e39
1 Parent(s): 8de1c9c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -49,13 +49,13 @@ def predict(number_of_days_ahead, hour_of_the_day):
49
  row = UserInputDays(number_of_days_ahead) + UserInputTime(hour_of_the_day)
50
  return predict2(row)
51
 
52
- def day_average(number_of_days_ahead):
53
- n = UserInputDays(number_of_days_ahead)
54
- if n == 0:
55
- return round(prediction.iloc[:23]['NBEATS'].mean(), 3)
56
- else:
57
- start_n = 23 + 24*(n-1)
58
- return round(prediction.iloc[start_n:start_n+24]['NBEATS'].mean(), 3)
59
 
60
  title = "ITI110 Energy Prediction"
61
  description = "This is an app to predict energy consumption in London over the next 7 days."
@@ -68,7 +68,7 @@ gr.Interface(predict,
68
  description = description,
69
  # css=css_code,
70
  inputs=[gr.Slider(0,6,1, step= 1, label='Select number of days ahead.'), gr.Slider(0,23,1, step= 1, label='Select hour of the day.')],
71
- outputs=[gr.Textbox(label='Predicted energy consumption at selected hour:'), gr.Textbox(label='Expected average energy consumption for the day:')],
72
  theme = 'finlaymacklon/smooth_slate'
73
  ).launch(share=True)
74
 
 
49
  row = UserInputDays(number_of_days_ahead) + UserInputTime(hour_of_the_day)
50
  return predict2(row)
51
 
52
+ # def day_average(number_of_days_ahead):
53
+ # n = UserInputDays(number_of_days_ahead)
54
+ # if n == 0:
55
+ # return round(prediction.iloc[:23]['NBEATS'].mean(), 3)
56
+ # else:
57
+ # start_n = 23 + 24*(n-1)
58
+ # return round(prediction.iloc[start_n:start_n+24]['NBEATS'].mean(), 3)
59
 
60
  title = "ITI110 Energy Prediction"
61
  description = "This is an app to predict energy consumption in London over the next 7 days."
 
68
  description = description,
69
  # css=css_code,
70
  inputs=[gr.Slider(0,6,1, step= 1, label='Select number of days ahead.'), gr.Slider(0,23,1, step= 1, label='Select hour of the day.')],
71
+ outputs=gr.Textbox(label='Predicted energy consumption at selected hour:'),
72
  theme = 'finlaymacklon/smooth_slate'
73
  ).launch(share=True)
74