Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,19 +59,6 @@ with tab1:
|
|
| 59 |
# Retrieving model
|
| 60 |
building_hist_model = get_building_model()
|
| 61 |
|
| 62 |
-
# Loading the feature view with latest data for building
|
| 63 |
-
#building_new_fv = fs.get_feature_view(
|
| 64 |
-
# name = 'building_new_fv',
|
| 65 |
-
# version = 1)
|
| 66 |
-
|
| 67 |
-
# Function to loading the feature view with latest data for building as a dataset
|
| 68 |
-
#@st.cache_data()
|
| 69 |
-
#def retrieve_building(feature_view=building_new_fv):
|
| 70 |
-
# building_new_fv = feature_view.get_batch_data()
|
| 71 |
-
# return building_new_fv
|
| 72 |
-
|
| 73 |
-
# Retrieving building data
|
| 74 |
-
#building_new = retrieve_building()
|
| 75 |
|
| 76 |
# Loading the feature group with latest data for building
|
| 77 |
api_building_newest_fg = fs.get_feature_group(name = 'api_building_newest', version = 1)
|
|
@@ -93,28 +80,25 @@ with tab1:
|
|
| 93 |
building_new = building_new.set_index(['time'])
|
| 94 |
st.dataframe(building_new[['prediction']].tail(5))
|
| 95 |
|
| 96 |
-
#
|
| 97 |
-
|
| 98 |
-
# Loading the feature view with latest data for bikelane
|
| 99 |
-
#bikelane_new_fv = fs.get_feature_view(
|
| 100 |
-
# name = 'bikelane_new_fv',
|
| 101 |
-
# version = 1)
|
| 102 |
|
| 103 |
-
# Function to loading the feature
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
# Retrieving bikelane data
|
| 110 |
-
#bikelane_new = retrieve_bikelane()
|
| 111 |
|
| 112 |
-
#
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
|
|
|
|
|
|
|
|
|
| 118 |
|
| 119 |
if st.button("Update status"):
|
| 120 |
st.rerun()
|
|
@@ -167,4 +151,41 @@ with tab4:
|
|
| 167 |
|
| 168 |
# Confusion Matrix
|
| 169 |
st.subheader("Confusion Matrix")
|
| 170 |
-
st.markdown('In this confusion matrix...')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
# Retrieving model
|
| 60 |
building_hist_model = get_building_model()
|
| 61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
# Loading the feature group with latest data for building
|
| 64 |
api_building_newest_fg = fs.get_feature_group(name = 'api_building_newest', version = 1)
|
|
|
|
| 80 |
building_new = building_new.set_index(['time'])
|
| 81 |
st.dataframe(building_new[['prediction']].tail(5))
|
| 82 |
|
| 83 |
+
# Loading the feature group with latest data for bikelane
|
| 84 |
+
api_bikelane_newest_fg = fs.get_feature_group(name = 'api_bikelane_newest', version = 1)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
+
# Function to loading the feature group with latest data for building as a dataset
|
| 87 |
+
@st.cache_data()
|
| 88 |
+
def retrieve_bikelane(feature_group=api_bikelane_newest_fg):
|
| 89 |
+
api_bikelane_newest_fg = feature_group.select(["time", "x", "y", "z"])
|
| 90 |
+
df_bikelane = api_bikelane_newest_fg.read()
|
| 91 |
+
return df_bikelane
|
|
|
|
|
|
|
| 92 |
|
| 93 |
+
# Retrieving building data
|
| 94 |
+
bikelane_new = retrieve_bikelane()
|
| 95 |
+
|
| 96 |
+
st.markdown('Parking Space near Bikelane:')
|
| 97 |
+
bikelane_most_recent_prediction = bikelane_new[['x', 'y', 'z']]
|
| 98 |
+
bikelane_most_recent_prediction = bikelane_hist_model.predict(bikelane_most_recent_prediction)
|
| 99 |
+
bikelane_new['prediction'] = bikelane_most_recent_prediction
|
| 100 |
+
bikelane_new = bikelane_new.set_index(['time'])
|
| 101 |
+
st.dataframe(bikelane_new[['prediction']].tail(5))
|
| 102 |
|
| 103 |
if st.button("Update status"):
|
| 104 |
st.rerun()
|
|
|
|
| 151 |
|
| 152 |
# Confusion Matrix
|
| 153 |
st.subheader("Confusion Matrix")
|
| 154 |
+
st.markdown('In this confusion matrix...')
|
| 155 |
+
|
| 156 |
+
# Loading the feature view with latest data for building
|
| 157 |
+
#building_new_fv = fs.get_feature_view(
|
| 158 |
+
# name = 'building_new_fv',
|
| 159 |
+
# version = 1)
|
| 160 |
+
|
| 161 |
+
# Function to loading the feature view with latest data for building as a dataset
|
| 162 |
+
#@st.cache_data()
|
| 163 |
+
#def retrieve_building(feature_view=building_new_fv):
|
| 164 |
+
# building_new_fv = feature_view.get_batch_data()
|
| 165 |
+
# return building_new_fv
|
| 166 |
+
|
| 167 |
+
# Retrieving building data
|
| 168 |
+
#building_new = retrieve_building()
|
| 169 |
+
|
| 170 |
+
# .style.applymap(color_prediction, subset=['prediction'])
|
| 171 |
+
|
| 172 |
+
# Loading the feature view with latest data for bikelane
|
| 173 |
+
#bikelane_new_fv = fs.get_feature_view(
|
| 174 |
+
# name = 'bikelane_new_fv',
|
| 175 |
+
# version = 1)
|
| 176 |
+
|
| 177 |
+
# Function to loading the feature view with latest data for bikelane as a dataset
|
| 178 |
+
#@st.cache_data()
|
| 179 |
+
#def retrieve_bikelane(feature_view=bikelane_new_fv):
|
| 180 |
+
# bikelane_new_fv = feature_view.get_batch_data()
|
| 181 |
+
# return bikelane_new_fv
|
| 182 |
+
|
| 183 |
+
# Retrieving bikelane data
|
| 184 |
+
#bikelane_new = retrieve_bikelane()
|
| 185 |
+
|
| 186 |
+
#st.markdown('Parking Space near Bikelane:')
|
| 187 |
+
#bikelane_most_recent_prediction = bikelane_new[['x', 'y', 'z']]
|
| 188 |
+
#bikelane_most_recent_prediction = bikelane_hist_model.predict(bikelane_most_recent_prediction)
|
| 189 |
+
#bikelane_new['prediction'] = bikelane_most_recent_prediction
|
| 190 |
+
#bikelane_new = bikelane_new.set_index(['time'])
|
| 191 |
+
#st.dataframe(bikelane_new[['prediction']].tail(5).style.applymap(color_prediction, subset=['prediction']))
|