Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -33,14 +33,15 @@ def train_model(X_train, y_train, model_name):
|
|
33 |
model.fit(X_train, y_train)
|
34 |
return model
|
35 |
|
36 |
-
|
|
|
37 |
st.sidebar.title("Navigation")
|
38 |
page = st.sidebar.radio("", ["📊 Vue d'ensemble", "🎯 Prédiction", "🔍 Interprétation", "⚙️ Entraînement"])
|
39 |
|
40 |
# Charger les données par défaut
|
41 |
if 'data' not in st.session_state:
|
42 |
-
|
43 |
-
|
44 |
st.session_state.test_data = load_data('exported_named_test_good.csv')
|
45 |
except:
|
46 |
st.session_state.data = None
|
@@ -197,4 +198,5 @@ elif page == "⚙️ Entraînement":
|
|
197 |
st.metric("Recall", f"{recall_score(y, y_pred):.2%}")
|
198 |
|
199 |
|
200 |
-
|
|
|
|
33 |
model.fit(X_train, y_train)
|
34 |
return model
|
35 |
|
36 |
+
def app():
|
37 |
+
# Sidebar pour la navigation
|
38 |
st.sidebar.title("Navigation")
|
39 |
page = st.sidebar.radio("", ["📊 Vue d'ensemble", "🎯 Prédiction", "🔍 Interprétation", "⚙️ Entraînement"])
|
40 |
|
41 |
# Charger les données par défaut
|
42 |
if 'data' not in st.session_state:
|
43 |
+
try:
|
44 |
+
st.session_state.data = load_data('exported_named_train_good.csv')
|
45 |
st.session_state.test_data = load_data('exported_named_test_good.csv')
|
46 |
except:
|
47 |
st.session_state.data = None
|
|
|
198 |
st.metric("Recall", f"{recall_score(y, y_pred):.2%}")
|
199 |
|
200 |
|
201 |
+
if __name__ == '__main__':
|
202 |
+
app()
|