cheikhaidev-ui Claude Sonnet 4.6 commited on
Commit ·
3493cb1
1
Parent(s): 79f0715
docs: fix PERFORMANCE.md code blocks and README image alt-text
Browse files- PERFORMANCE.md: replace broken \\\python markers with proper triple
backticks (4 code blocks + inline backslash-delimited file names)
- README.md: fix image alt-text Analytics -> Statistiques to match
current tab name (image file analytics.png kept as-is)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- PERFORMANCE.md +13 -13
- README.md +2 -2
PERFORMANCE.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
| 7 |
### LightGBM (Gradient Boosting)
|
| 8 |
- **Framework** : LightGBM
|
| 9 |
- **Type** : Gradient Boosting Decision Tree
|
| 10 |
-
- **Fichier** :
|
| 11 |
- **Statut** : ✅ Entraîné et validé
|
| 12 |
|
| 13 |
**Configuration** :
|
|
@@ -23,7 +23,7 @@
|
|
| 23 |
### LSTM (Deep Learning)
|
| 24 |
- **Framework** : TensorFlow/Keras
|
| 25 |
- **Type** : Réseau de neurones récurrent (LSTM)
|
| 26 |
-
- **Fichier** :
|
| 27 |
- **Statut** : ✅ Entraîné et validé
|
| 28 |
|
| 29 |
**Architecture** :
|
|
@@ -85,25 +85,25 @@ Le système classe les prédictions en 3 niveaux :
|
|
| 85 |
## 🔬 Méthodologie d'Entraînement
|
| 86 |
|
| 87 |
### 1. Prétraitement
|
| 88 |
-
|
| 89 |
- Chargement du dataset (70 000 lignes)
|
| 90 |
- Séparation features (X) / target (y)
|
| 91 |
- Split train/test (80/20)
|
| 92 |
- Normalisation avec StandardScaler (fit sur train)
|
| 93 |
-
|
| 94 |
|
| 95 |
### 2. Entraînement LightGBM
|
| 96 |
-
|
| 97 |
lgb_model = LGBMClassifier(
|
| 98 |
n_estimators=100,
|
| 99 |
max_depth=5,
|
| 100 |
random_state=42
|
| 101 |
)
|
| 102 |
lgb_model.fit(X_train, y_train)
|
| 103 |
-
|
| 104 |
|
| 105 |
### 3. Entraînement LSTM
|
| 106 |
-
|
| 107 |
model = Sequential([
|
| 108 |
LSTM(64, input_shape=(1, n_features), return_sequences=True),
|
| 109 |
Dropout(0.2),
|
|
@@ -113,12 +113,12 @@ model = Sequential([
|
|
| 113 |
])
|
| 114 |
model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
|
| 115 |
model.fit(X_train_lstm, y_train, epochs=10, batch_size=32)
|
| 116 |
-
|
| 117 |
|
| 118 |
### 4. Sauvegarde
|
| 119 |
-
- LightGBM :
|
| 120 |
-
- LSTM :
|
| 121 |
-
- Scaler :
|
| 122 |
|
| 123 |
## 📈 Validation en Production
|
| 124 |
|
|
@@ -139,7 +139,7 @@ model.fit(X_train_lstm, y_train, epochs=10, batch_size=32)
|
|
| 139 |
|
| 140 |
Les prédictions sont ajustées selon les caractéristiques de chaque quartier :
|
| 141 |
|
| 142 |
-
|
| 143 |
QUARTIER_ADJUSTMENT = {
|
| 144 |
"Guédiawaye": 1.15, # +15% risque
|
| 145 |
"Pikine": 1.20, # +20% risque (absent du training)
|
|
@@ -150,7 +150,7 @@ QUARTIER_ADJUSTMENT = {
|
|
| 150 |
"Mermoz-Sacré-Cœur": 0.90, # -10% risque
|
| 151 |
"Dakar-Plateau": 0.85, # -15% risque
|
| 152 |
}
|
| 153 |
-
|
| 154 |
|
| 155 |
## ✅ Conclusion
|
| 156 |
|
|
|
|
| 7 |
### LightGBM (Gradient Boosting)
|
| 8 |
- **Framework** : LightGBM
|
| 9 |
- **Type** : Gradient Boosting Decision Tree
|
| 10 |
+
- **Fichier** : `models/lgbm_model.pkl`
|
| 11 |
- **Statut** : ✅ Entraîné et validé
|
| 12 |
|
| 13 |
**Configuration** :
|
|
|
|
| 23 |
### LSTM (Deep Learning)
|
| 24 |
- **Framework** : TensorFlow/Keras
|
| 25 |
- **Type** : Réseau de neurones récurrent (LSTM)
|
| 26 |
+
- **Fichier** : `models/lstm_model.keras`
|
| 27 |
- **Statut** : ✅ Entraîné et validé
|
| 28 |
|
| 29 |
**Architecture** :
|
|
|
|
| 85 |
## 🔬 Méthodologie d'Entraînement
|
| 86 |
|
| 87 |
### 1. Prétraitement
|
| 88 |
+
```
|
| 89 |
- Chargement du dataset (70 000 lignes)
|
| 90 |
- Séparation features (X) / target (y)
|
| 91 |
- Split train/test (80/20)
|
| 92 |
- Normalisation avec StandardScaler (fit sur train)
|
| 93 |
+
```
|
| 94 |
|
| 95 |
### 2. Entraînement LightGBM
|
| 96 |
+
```python
|
| 97 |
lgb_model = LGBMClassifier(
|
| 98 |
n_estimators=100,
|
| 99 |
max_depth=5,
|
| 100 |
random_state=42
|
| 101 |
)
|
| 102 |
lgb_model.fit(X_train, y_train)
|
| 103 |
+
```
|
| 104 |
|
| 105 |
### 3. Entraînement LSTM
|
| 106 |
+
```python
|
| 107 |
model = Sequential([
|
| 108 |
LSTM(64, input_shape=(1, n_features), return_sequences=True),
|
| 109 |
Dropout(0.2),
|
|
|
|
| 113 |
])
|
| 114 |
model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
|
| 115 |
model.fit(X_train_lstm, y_train, epochs=10, batch_size=32)
|
| 116 |
+
```
|
| 117 |
|
| 118 |
### 4. Sauvegarde
|
| 119 |
+
- LightGBM : `pickle.dump()` → `lgbm_model.pkl`
|
| 120 |
+
- LSTM : `model.save()` → `lstm_model.keras`
|
| 121 |
+
- Scaler : `pickle.dump()` → `scaler.pkl`
|
| 122 |
|
| 123 |
## 📈 Validation en Production
|
| 124 |
|
|
|
|
| 139 |
|
| 140 |
Les prédictions sont ajustées selon les caractéristiques de chaque quartier :
|
| 141 |
|
| 142 |
+
```python
|
| 143 |
QUARTIER_ADJUSTMENT = {
|
| 144 |
"Guédiawaye": 1.15, # +15% risque
|
| 145 |
"Pikine": 1.20, # +20% risque (absent du training)
|
|
|
|
| 150 |
"Mermoz-Sacré-Cœur": 0.90, # -10% risque
|
| 151 |
"Dakar-Plateau": 0.85, # -15% risque
|
| 152 |
}
|
| 153 |
+
```
|
| 154 |
|
| 155 |
## ✅ Conclusion
|
| 156 |
|
README.md
CHANGED
|
@@ -133,8 +133,8 @@ streamlit run streamlit_app/app.py
|
|
| 133 |
### Carte Interactive des Quartiers
|
| 134 |

|
| 135 |
|
| 136 |
-
###
|
| 137 |
-

|
| 135 |
|
| 136 |
+
### Statistiques et Tendances
|
| 137 |
+

|
| 138 |
|
| 139 |
---
|
| 140 |
|