feat(viz): plot one donor's score explanation from `explain_donor_scores`
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- matplotlib, python, scikit-learn
- Ambito
- data-visualization
Direzione di ricerca
Parti dalla forma delle righe restituite da explain_donor_scores in philanthropy/inspection/_explain.py, poi guarda come philanthropy/visualisation/_plots.py importa matplotlib in modo lazy. Aggiungi plot_score_explanation in philanthropy/visualisation/ in modo che disegni un grafico a barre orizzontali per i segnali top_n di un donatore e restituisca l'Axes. È completato quando i test con il backend Agg verificano numero, ordine ed etichette delle barre e il job CI senza matplotlib continua a passare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Goal
A gift officer can see why one donor scored high: a small bar chart of the signals that moved that donor's score, built from the existing explain_donor_scores output.
Acceptance criteria
-
philanthropy.visualisation.plot_score_explanation(explanation, row, ax=None)draws a horizontal bar chart from one donor's rows of theexplain_donor_scoresresult and returns theAxes.rowmatches the result's ownrowcolumn (the index label ofX, or the position for an array); there is nodonor_idcolumn. Bars are ordered byrankand signed bycontribution. - No
top_nargument:explain_donor_scoresalready returnstop_krows per donor (default 3), so the plot draws what it is given and the docstring says to raisetop_kfor more bars. Arowthat is not in the frame raises aValueErrornaming it. - Uses matplotlib only (the existing
vizextra), imported lazily inside the function asphilanthropy/visualisation/_plots.pydoes, so importing the package never needs it. - Tests use the Agg backend and check bar count, order and labels; the no-matplotlib CI job still passes.
- Exported from
philanthropy.visualisationand its__all__, with a tier row indocs/reference/index.md(a test fails without one). - One image in the "Explain a donor's score" how-to.
- CHANGELOG entry.
Scope
Plotting only. No SHAP dependency: this rescopes #5 now that explain_donor_scores (#326) ships per-donor explanations with the existing stack.
Where to start
philanthropy/inspection/_explain.py(the input shape)philanthropy/visualisation/for the existing plot helpers' conventionsdocs/how-to/explain_a_donor_score.md
Dependencies
- Supersedes the plotting half of #5
Phase order is a release plan, not a rule against picking up independent work early. Comment on this issue before you start so two people don't build the same thing.
- Lingua principale
- Python
- Stelle
- 11
- Fork
- 23
- Merge medio
- 1g 11h
- PR unite (30g)
- 30
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PhilanthroPy-Project/PhilanthroPy
-
bug roadmap
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
PhilanthroPy-Project/PhilanthroPy#366 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue roadmap
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
PhilanthroPy-Project/PhilanthroPy#361 ·
I maintainer di solito rispondono entro 1 giorno
-
docs: `read_gifts` docstring names 5 of the 7 `GIFT_SOURCES`, and two registry comments point at CLI code that is going awayForse già presa @shivamlalakiya l’ha presa oggi. Apertabeginner documentation good first issue roadmap
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
PhilanthroPy-Project/PhilanthroPy#360 ·
I maintainer di solito rispondono entro 1 giorno
-
beginner documentation good first issue roadmap
Difficoltà 2/5 Mezza giornata Idoneità per principianti 68/100
PhilanthroPy-Project/PhilanthroPy#342 ·
I maintainer di solito rispondono entro 1 giorno
-
beginner enhancement good first issue roadmap
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PhilanthroPy-Project/PhilanthroPy#340 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di PhilanthroPy-Project/PhilanthroPy
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
fritzprix/libr-agent#2612 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-triage presubmit-gate
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
gke-labs/kube-agents#5001 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
simonw/sqlite-utils#928 ·
I maintainer di solito rispondono entro 3 giorni
-
colorado
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
freelawproject/juriscraper#2405 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
cline/mcp-marketplace#3576 ·