SebastianoMeneghin commited on
Commit
240dc2e
·
verified ·
1 Parent(s): a28025d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -2
app.py CHANGED
@@ -69,7 +69,16 @@ def get_specific_flights(day, max_delay, departure_hour, ampm, weather, destinat
69
  def full_day_departure(day):
70
  return get_dataframe_of(day)
71
 
72
-
 
 
 
 
 
 
 
 
 
73
 
74
  specific_flights = gr.Interface(
75
  get_specific_flights,
@@ -95,7 +104,9 @@ total_departure = gr.Interface(
95
  "dataframe",
96
  )
97
 
 
 
98
  #flights.launch()
99
 
100
- interface = gr.TabbedInterface([specific_flights, total_departure], {"Full Day Departure", "Specific Flights"})
101
  interface.launch()
 
69
  def full_day_departure(day):
70
  return get_dataframe_of(day)
71
 
72
+ def get_metrics():
73
+ # Connect to Hopsworks File System
74
+ dataframe = hopsworks.login(api_key_value = os.environ['HOPSWORKS_API_KEY'])
75
+ dataframe = dataframe.get_feature_store()
76
+ dataframe = dataframe.get_feature_group(name = 'model_performance', version = 1)
77
+ dataframe = dataframe.read(dataframe_type = 'pandas')
78
+ dataframe = dataframe.sort_values('timestamp')
79
+ dataframe = dataframe[['timestamp', 'mae', 'dateset_size']].rename(columns={'dateset_size':'Dataset Size', 'mae':'Mean Absolute Error', 'timestamp':'Date'})
80
+ dataframe = dataframe.sort_values(['Date'], ascending = False)
81
+ return dataframe
82
 
83
  specific_flights = gr.Interface(
84
  get_specific_flights,
 
104
  "dataframe",
105
  )
106
 
107
+ metrics = gr.Interface(fn = get_metrics, inputs=None, outputs='dataframe', allow_flagging="never")
108
+
109
  #flights.launch()
110
 
111
+ interface = gr.TabbedInterface([specific_flights, total_departure, metrics_], {"Full Day Departure", "Specific Flights", "Model Performances"})
112
  interface.launch()