[BACK] fix(scoring): update subsidy transparency score thresholds#489
Merged
jb-delafosse merged 2 commits intomainfrom Jan 21, 2026
Merged
[BACK] fix(scoring): update subsidy transparency score thresholds#489jb-delafosse merged 2 commits intomainfrom
jb-delafosse merged 2 commits intomainfrom
Conversation
4 tasks
9ac831e to
9397d88
Compare
tomperr
reviewed
Jan 15, 2026
Comment on lines
268
to
271
| if math.isnan(tp) or tp < 0: | ||
| return "E" # Données invalides | ||
| if tp == 0: | ||
| return "E" # Aucune donnée exploitable |
There was a problem hiding this comment.
👋
Suggested change
| if math.isnan(tp) or tp < 0: | |
| return "E" # Données invalides | |
| if tp == 0: | |
| return "E" # Aucune donnée exploitable | |
| if math.isnan(tp) or tp <= 0: | |
| return "E" # Données invalides ou inexploitables |
Collaborator
Author
Distribution actuelle des scores en productionVoici la distribution actuelle avant l'application des nouveaux seuils :
Cela confirme le besoin d'ajuster les seuils : 99.98% des (collectivités,année) ont un score E pour les subventions, montrant une mauvaise discrimination dans les scores bas. |
Collaborator
Author
Mise à jour appliquée en production ✅Comparaison avant/après
*Le nombre total de (collectivités,année) a augmenté de 362 030 à 398 222 (nouvelles (collectivités,année) ajoutées au dataset avec 2026 Amélioration cléLes collectivités ayant publié des subventions sont maintenant mieux discriminées :
Les nouveaux seuils fonctionnent comme prévu. |
Adjust the scoring scale to better discriminate communities at the low end: - E: 0% only (no usable data) or >105% (suspicious over-declaration) - D: ]0%, 25%] (minimal effort) - C: ]25%, 50%] (significant under-declaration) - B: ]50%, 95%] (partial to good declaration) - A: ]95%, 105%] (optimal declaration) Also adds explicit handling for invalid values (NaN, negative) returning E. no_jira
Add comprehensive tests for the subsidy transparency scoring function: - Test all score levels (A, B, C, D, E) - Test boundary values (0, 25, 50, 95, 105) - Test invalid values (negative, NaN) - Test over-declaration cases (>105%) no_jira
6d76e59 to
a27bee0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New scoring thresholds
Changes
get_score_from_tp()function inbareme_enricher.pyTest plan