analist commited on
Commit
6cd1c2c
·
verified ·
1 Parent(s): c56da91

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -16,6 +16,12 @@ def load_model_and_data():
16
  # feature_names = X.columns
17
  with open('DecisionTreeModel.pkl', 'rb') as f:
18
  model = pickle.load(f)
 
 
 
 
 
 
19
 
20
 
21
  def app():
@@ -25,10 +31,12 @@ def app():
25
  st.sidebar.header("Paramètres d'analyse")
26
 
27
  # Section 1: Vue globale du modèle
28
- st.header("1. Vue globale du modèle")
29
  col1, col2 = st.columns(2)
30
 
31
  with col1:
 
 
32
  st.subheader("Importance des caractéristiques")
33
  importance_plot = plt.figure(figsize=(10, 6))
34
  # Remplacer par vos features et leurs importances
 
16
  # feature_names = X.columns
17
  with open('DecisionTreeModel.pkl', 'rb') as f:
18
  model = pickle.load(f)
19
+ data = pd.read_csv('exported_named_train.csv')
20
+ X = data.drop("Target", axis=1)
21
+ y = data['Target']
22
+
23
+ return model, X, y
24
+
25
 
26
 
27
  def app():
 
31
  st.sidebar.header("Paramètres d'analyse")
32
 
33
  # Section 1: Vue globale du modèle
34
+ st.header("Vue globale du modèle")
35
  col1, col2 = st.columns(2)
36
 
37
  with col1:
38
+ model, X, y = load_model_and_data()
39
+ feature_names = X.columns
40
  st.subheader("Importance des caractéristiques")
41
  importance_plot = plt.figure(figsize=(10, 6))
42
  # Remplacer par vos features et leurs importances