Commit History
15 days ago
-
feat(app): avertir quand les entrées sortent des plages d'entraînement
- config.py : TRAINING_RANGES (min/max du CSV : température 16-37,8 °C, humidité 50-95 %, vent 2-20 km/h, conso 400-1400 MW) et CONSO_RANGE_BY_PEAK (900-1400 MW en pointe, 400-900 MW hors pointe, sans recouvrement dans le CSV) - utils_simple.check_training_range() liste les entrées hors plage - app.py : avertissement « hors plage d'entraînement » dans la barre latérale, sur la prédiction et sur la carte ; aide des sliders avec la plage d'entraînement. Les sliders ne sont pas bloqués - Tests : plages comparées au CSV (couverture et marge < 0,5), détection hors plage et incohérence conso/heure de pointe Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>657a409 -
fix(risque): afficher la vraie probabilité et redéfinir les seuils
- Suppression du « ×2 » (PREDICTION_THRESHOLD) : le risque affiché est la moyenne des probabilités brutes LightGBM/LSTM, déjà bien calibrée (14,1 % prédit en moyenne pour 14,05 % observé) - Coefficient de quartier appliqué AVANT le plafonnement à 100 % - Suppression du plancher artificiel de 5 % (RISK_FLOOR) - Seuils 40/70 % → 15/35 %, fixés sur la distribution du test : FAIBLE 61,4 % des cas (2,5 % de coupures réelles), MOYEN 24,9 % (22,0 %), ÉLEVÉ 13,7 % (51,5 %) - Jauge, lignes de seuil et messages pilotés par RISK_THRESHOLDS ; affichage à 0,1 % près ; légende expliquant le score - Un échec de LightGBM affiche une erreur au lieu d'un 50 % fictif - Prédiction unique et carte partagent le même code (_predict_probas_pct, apply_quartier_adjustment) - Tests : seuils, absence de rescaling et de plancher, ordre coefficient/plafond, cohérence carte/prédiction ; la CI lance tests/ - Docs : README, PERFORMANCE, CLAUDE.md, CHANGELOG Co-Authored-By: Claude Opus 5.5 <noreply@anthr…fd738e7 -
fix(inférence): réaligner saison et heure de pointe sur le CSV d'entraînement
Le commit 554fba2 avait aligné create_time_features() sur data_generator.py (3 saisons, pointe 7-9h + 18-21h) sans réentraîner. Or les modèles ont appris sur synthetic_data_v2.csv : saison binaire (1 = juin-août) et pointe 18h-22h. Conséquence : saison=2 jamais vue, 22h prédit ≈ 0 % (43 % dans les données), AUC 0,873 → 0,834. - utils_simple.py : encodage du CSV, constantes SAISON_MONTHS et PEAK_HOUR_START/END - tests/test_features.py : compare l'encodage aux paires (mois, saison) et (heure, is_peak_hour) lues dans le CSV, plus des valeurs explicites - CI : checkout avec lfs: true pour disposer du CSV - CLAUDE.md, PERFORMANCE.md, CHANGELOG, aide du slider heure : mis en cohérence Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>26e90d4 -
chore(deploy): unifier le port sur 7860 et nettoyer les fichiers obsolètes
- 7860 est le port attendu par Hugging Face Spaces et déjà utilisé par le Dockerfile et .streamlit/config.toml : CLAUDE.md (8501) aligné, README indique l'URL locale - .env.example : retrait des variables Supabase (intégration supprimée) - Dockerfile : accent cassé corrigé (« nécessaires ») Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>c08ed38 -
docs: publier les vraies métriques des modèles
- PERFORMANCE.md : remplace les chiffres et la configuration inexacts (LGBMClassifier max_depth=5, LSTM 10 epochs, pic 7-9h, saison 0/1/2) par la configuration réelle de 2_train_models.py et le tableau mesuré (AUC, PR-AUC, précision, rappel, F1, matrices de confusion) avec la référence « jamais de coupure » (exactitude 85,95 %) - Signale le biais optimiste : le jeu de test a servi à l'arrêt anticipé de LightGBM et du LSTM et au choix du seuil 0,25 - Notebook 02 : remplace la conclusion inventée (AUC ~0,93, F1 ~0,55, classe ~8 %) par les métriques mesurées - README : ajoute l'AUC et la comparaison à la référence Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>4681be1 -
docs: corriger les affirmations fausses sur les quartiers et Python
- Pikine et Fann sont bien dans synthetic_data_v2.csv : retrait des mentions « absents de l'entraînement » (config.py, app.py, README, PERFORMANCE, CHANGELOG) ; la légende de la carte explique désormais que le quartier est un coefficient, pas une feature - « 6 quartiers entraînés » → 8 quartiers - Python 3.9+ → 3.10+ (le code utilise la syntaxe dict | None) - README : retrait de « gestion native des variables catégorielles » (aucune n'est utilisée) et du pic 7-9h, absent des données Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>4ccfebd -
docs: lever toute ambiguïté sur le caractère synthétique des données
- Supprime la mention « SENELEC (données historiques) » et le commentaire « Métriques globales SENELEC » dans app.py - Ajoute un bandeau « Données synthétiques : démonstration technique, pas des mesures du réseau SENELEC » en tête de l'app et du README - Reformule « temps réel », « réalistes », « historiques », « validés », « testés en conditions réelles » (README, PERFORMANCE, CHANGELOG, docstrings de data_generator.py) - Renomme l'onglet « Historique » en « Tendances » Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>58cb03d
-
fix(model): lower decision threshold to 0.25 for better recall on minority class
cheikhaidev-ui +1: Claude Sonnet 4.6Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>e4c3989
-
docs(deploy): remove stale Supabase secrets from DEPLOY.md
cheikhaidev-ui +1: Claude Sonnet 4.6Integration was dropped in v1.1.0; no env vars required since then. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>b5cabf8 -
fix(gitignore): rewrite in clean UTF-8, add *.db rule
cheikhaidev-ui +1: Claude Sonnet 4.6Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>a2d24a8 -
docs(images): regenerate screenshots post-coherence fixes
cheikhaidev-ui +1: Claude Sonnet 4.6Screenshots were outdated (old tab names Analytics/Export, old quartier list). Regenerated from the live HF Space after: - tabs renamed: Statistiques + Historique (was Analytics) - quartiers corrected: Sicap-Liberte, Yoff, Mermoz, Fann - viewport 1920x1080 for sharper carte.png Also adds scripts/take_screenshots.py (Playwright + system Chrome) as reusable tooling for future screenshot updates. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1927413 -
docs: fix PERFORMANCE.md code blocks and README image alt-text
cheikhaidev-ui +1: Claude Sonnet 4.6- 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>3493cb1 -
fix: coherence README/config et securite credentials
cheikhaidev-ui +1: Claude Sonnet 4.6- README: quartiers alignes sur config.py (Sicap-Liberte/Yoff/Mermoz/Fann) - README: onglets corriges (Analytics->Statistiques+Historique) - config.py: cle Supabase -> os.environ.get() - Ajout .env.example et DEPLOY.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>79f0715
-
test(ci): add test_features.py to CI pipeline and fix stale assertions
cheikhaidev-ui +1: Claude Sonnet 4.6- Add tests/test_features.py to pytest run in ci.yml - Fix test_saison_juillet: expected value 1 → 2 (saison des pluies) - Add test_saison_avril: covers saison sèche chaude (→ 1) - Add test_is_peak_hour_8h: covers morning peak (7-9h) added in last fix Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>f121cdb -
docs(changelog): add v1.1.0 entry and fix placeholder date
cheikhaidev-ui +1: Claude Sonnet 4.6- Add [1.1.0] entry documenting all fixes from this session - Fix "8 quartiers" to clarify 6 trained + 2 estimated - Replace 2024-XX-XX placeholder with 2024-12-01 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>3566034 -
refactor: centralize risk thresholds, floor and slider config in config.py
cheikhaidev-ui +1: Claude Sonnet 4.6- Add RISK_THRESHOLDS, RISK_FLOOR, SLIDER_CONFIG to src/config.py - Update classify_risk() to use RISK_THRESHOLDS - Replace all hardcoded 40/70 thresholds and 5.0 floor in utils_simple.py - Replace hardcoded slider ranges in app.py with SLIDER_CONFIG - Fix peak hour help text: 18-22h → 7-9h et 18-21h Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>a937dc4 -
fix(readme): remove unverifiable claims and misleading statements
cheikhaidev-ui +1: Claude Sonnet 4.6- Remove accuracy claims (~88%, ~90%, 88-90%) — not formally validated - Fix ensemble method: weighted → simple average - Fix LSTM: 1 layer → 2 layers - Fix features list: remove Quartier (post-prediction adjustment, not a feature) - Replace fabricated "65% chaleur" insight with factual synthetic data pattern - Remove Pikine from insights (absent from training data) - Fix peak hours: 19-22h → 18-21h and 7-9h - Clarify Pikine/Fann as geographic estimates in zones list - Rename "Insights Métier" → "Patterns observés dans les données synthétiques" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>2eff224 -
fix(docs): align PERFORMANCE.md with actual code
cheikhaidev-ui +1: Claude Sonnet 4.6- Fix LSTM architecture: 1 layer → 2 layers (64 + 32 units) - Fix ensemble method: weighted average → simple average - Fix validation note: données réelles → données synthétiques - Fix saison feature: (1-4) → (0/1/2, 3 saisons Dakar) - Fix is_peak_hour: add hours range (7-9h et 18-21h) - Fix quartier: clarify it is a post-prediction adjustment, not a feature - Fix LSTM code snippet to reflect real architecture - Fix QUARTIER_ADJUSTMENT: correct 4 wrong values to match src/config.py Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>3ee553b -
fix(critical): align saison/peak_hour encoding + restore TensorFlow on HF
cheikhaidev-ui +1: Claude Sonnet 4.6- utils_simple.create_time_features(): fix saison from binary {0,1} to 3-season Dakar encoding {0,1,2} matching data_generator.get_season() - utils_simple.create_time_features(): fix is_peak_hour to include 7-9h morning peak matching data_generator.is_peak_hour() - requirements-hf.txt: restore tensorflow-cpu==2.17.1 so LSTM loads on HF Spaces (previously removed to avoid build timeout) - Dockerfile: remove outdated comment about missing TensorFlow - CLAUDE.md: document correct saison and is_peak_hour invariants Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>554fba2 -
chore(app): remove unused QUARTIER_ADJUSTMENT import
cheikhaidev-ui +1: Claude Sonnet 4.6Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>6273b40 -
refactor(map): extract compute_map_risks() from tab2 inline logic
cheikhaidev-ui +1: Claude Sonnet 4.6Move vectorized batch prediction for all quartiers into a reusable compute_map_risks() function in utils_simple.py and replace the 18-line inline block in tab2 with a single call. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>9a0b5bd -
fix: correct record count from 70 001 to 70 000 across docs
cheikhaidev-ui +1: Claude Sonnet 4.6Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>b37f222 -
fix: correct record count from 70,001 to 70,000 in app and CLAUDE.md
cheikhaidev-ui +1: Claude Sonnet 4.6Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>498ea04 -
docs(CLAUDE.md): remove Supabase references after integration removal
cheikhaidev-ui +1: Claude Sonnet 4.6Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>0ea7539 -
chore(config): remove unused SEUILS_RISQUE, TEMPERATURE_RANGES, CONSO_RANGES
cheikhaidev-ui +1: Claude Sonnet 4.6Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>e7a6c23 -
fix(map): add disclaimer caption for Pikine and Fann estimates
cheikhaidev-ui +1: Claude Sonnet 4.6Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>915dfb0 -
fix(quartiers): normalize Guédiawaye accent across config and rename map
cheikhaidev-ui +1: Claude Sonnet 4.6Add 'Guediawaye' → 'Guédiawaye' to _QUARTIER_RENAME in app.py and update all three occurrences in src/config.py (QUARTIERS_DAKAR, COORDONNEES_QUARTIERS, QUARTIER_ADJUSTMENT) for consistency. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>8fd2116
-
chore: remove Supabase integration (database.py, load script, config)
cheikhaidev-ui +1: Claude Sonnet 4.6Drop src/database.py, scripts/3_load_to_supabase.py and the SUPABASE_CONFIG block from src/config.py — the app no longer depends on any Supabase connection. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>5ae4a65 -
fix(map): apply 5% risk floor on map + interpolate temporal chart gaps
cheikhaidev-uic0e7040 -
fix(predictions): add 5% risk floor + calibrate charts + update README
cheikhaidev-ui- fix(predictions): add minimum 5% risk floor (residual network risk) - fix(chart): raise temporal filter threshold to 400 MW to remove empty weeks - fix(forecast): fix precipitation Y-axis range [0-20mm] - fix(forecast): fix temperature Y-axis range [20-45C] for Dakar context - docs(readme): correct quartier names, update author title, add weather API featured6ea9c6 -
fix(ux): auto map + hour slider + dark theme + data fixes
cheikhaidev-ui- fix(map): remove button gate, map now auto-renders on parameter change - fix(predictions): add hour slider (0-23) to control is_peak_hour correctly - fix(map): carte updates dynamically with all sidebar parameters - fix(weather): clamp precipitation to 0 (no negative values) - fix(chart): filter empty weeks in temporal chart (conso > 100 MW) - feat(theme): add Streamlit dark theme with red primary colore49e56b
-
fix(charts): weekly aggregation + contextual annotations
cheikhaidev-ui- fix(temporal): replace random 1000-sample with weekly resample (reproducible, readable) - fix(stats): add annotation on 18-22h peak (SENELEC context) - fix(stats): add annotation on Dec/Feb anomaly (synthetic dataset limitation)472a145 -
feat(v2): SENELEC dashboard + 7-day forecast + fixed quartier names
cheikhaidev-ui- feat(stats): add 4 KPI metrics (total outages, highest risk area, avg rate, avg temp) - feat(stats): add hourly risk lineplot + monthly risk barplot - feat(forecast): add 7-day weather forecast chart (temp + precipitation) - fix(data): normalize quartier names with accents at CSV load (Sicap-Liberté, Mermoz-Sacré-Coeur)09a6a42 -
feat(v2): add real-time weather API + improved map colors
cheikhaidev-ui- feat(weather): integrate Open-Meteo API for real Dakar weather data - feat(sidebar): add weather button to auto-fill sliders with live data - feat(map): colored markers by risk level (green/orange/red), size=20, zoom=11 - Live test: Dakar 25.2C, 82% humidity, 7.4 km/h windd248d81 -
fix(hf): stabilize websocket connection on HF Spaces free tier
cheikhaidev-uifa90692 -
fix(hf): switch to port 7860 required by HF Spaces Docker
cheikhaidev-ui84eda1b -
fix(docker): remove tensorflow from HF build to fix 30min timeout
cheikhaidev-ui- Add requirements-hf.txt without tensorflow for Docker/HF deployment - Make keras/tensorflow import optional in utils_simple.py - LightGBM-only mode when TF unavailable (graceful degradation) - Local dev keeps tensorflow-cpu==2.17.1 via requirements.txtc27655a -
fix(docker): align Python 3.12-slim with tensorflow-cpu 2.17.1
cheikhaidev-ui- Dockerfile: python:3.11-slim → python:3.12-slim - requirements.txt: tensorflow-cpu 2.16.1 → 2.17.1 - Stack now consistent: local Python 3.12.5 = Docker 3.12-slim = TF 2.17.106ad55e
-
fix(ci): run only test_config.py to avoid streamlit headless issues
cheikhaidev-ui8571801 -
fix(ci): mock streamlit for headless CI, add missing dependencies
cheikhaidev-ui- fix(ci): add streamlit and plotly to pip install in ci.yml - fix(tests): mock streamlit module before import to fix headless CI failure6277f27 -
feat: add notebooks, badges, and eliminate classify_risk duplications (batch 4/4)
cheikhaidev-ui- feat(notebooks): add 01_EDA.ipynb (7 cells: distributions, correlations, temporal patterns) - feat(notebooks): add 02_model_evaluation.ipynb (11 cells: metrics, ROC, confusion matrix, feature importance) - refactor(app): replace 6 inline risk classification expressions with classify_risk() - docs(readme): add CI badge and HF Spaces live badge (5 badges total)a408d59 -
test: add pytest test suite and GitHub Actions CI (batch 3/3)
cheikhaidev-ui- test(config): 5 tests for classify_risk() and QUARTIERS_DAKAR integrity - test(features): 5 tests for create_time_features() encoding correctness - ci: add GitHub Actions workflow (Python 3.12, pytest on push/PR to main) - All 10 tests passing locallyefe72c1 -
perf: vectorize data generation and batch map predictions (batch 2/3)
cheikhaidev-ui- perf(data_generator): replace 52,560-iter Python loop with numpy vectorized ops (~20-50x faster) - perf(supabase): replace iterrows() with to_dict('records'), add timeout=30, exponential backoff on error - perf(app): batch 8 map predictions into single numpy matrix call (8x fewer model invocations) - fix(app): initialize results=[] before model availability check to prevent NameError1c045e4 -
fix(hf): add required YAML metadata to README for HF Spaces
cheikhaidev-ui0d55d9d -
refactor: improve code quality (batch 1/3)
cheikhaidev-ui- feat(config): add classify_risk() function with type hints, eliminates 5 duplications - refactor(app): replace wildcard import with 8 explicit named imports - fix(utils): replace global warnings.filterwarnings with targeted keras/lightgbm filters - chore(src): remove dead MySQL config from __init__.py - fix(error-handling): replace 4 bare except: with except Exception as e + loggingf76db68 -
fix: correct critical feature encoding bugs + retrain models
cheikhaidev-ui +1: Claude Sonnet 4.6BREAKING FIX: silent wrong predictions in production resolved - fix(inference): align saison encoding with training CSV (binary 0/1, pluies=Jun-Aug) - fix(inference): align is_peak_hour with training CSV (18-22h, evening only) - fix(inference): remove invalid predict_proba fallback on lgb.Booster - fix(config): harmonize quartier names with accents (Sicap-Liberté, Mermoz-Sacré-Cœur) - fix(config): remove module-level print() causing UnicodeEncodeError on Windows - chore(deps): upgrade tensorflow-cpu 2.15.0 → 2.17.1 (Python 3.12 support) - chore(models): retrain LightGBM (87.42%) and LSTM (87.31%) with corrected encodings Audit performed by Claude Code — 22 issues found, 4 critical bugs fixed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>3e4b260
-
Revise Cheikh Niang's contact links in README
Unverified signatureUpdated LinkedIn and Portfolio links for Cheikh Niang.fd9b3d1 -
docs: amélioration README professionnel avec contexte business, résultats et screenshots
1574029
-
Install libgomp1 to fix LightGBM library error
593c4fa -
Fix README encoding and change port to 8501
b8f73cf