feat(viz): plot one donor's score explanation from `explain_donor_scores`
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- matplotlib, python, scikit-learn
- Área
- data-visualization
Línea de trabajo
Empieza con la forma de las filas que devuelve explain_donor_scores en philanthropy/inspection/_explain.py y luego revisa cómo philanthropy/visualisation/_plots.py importa matplotlib de forma diferida. Añade plot_score_explanation a philanthropy/visualisation/ para que dibuje un gráfico de barras horizontal con las señales top_n de un donante y devuelva el Axes. Está terminado cuando las pruebas con el backend Agg verifican el número de barras, su orden y sus etiquetas, y el trabajo de CI sin matplotlib sigue pasando.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 11
- Forks
- 23
- Merge medio
- 1 d 11 h
- PR fusionados (30 d)
- 30
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PhilanthroPy-Project/PhilanthroPy
-
bug roadmap
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
PhilanthroPy-Project/PhilanthroPy#366 ·
Los mantenedores suelen responder en 1 día
-
documentation good first issue roadmap
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
PhilanthroPy-Project/PhilanthroPy#361 ·
Los mantenedores suelen responder en 1 día
-
docs: `read_gifts` docstring names 5 of the 7 `GIFT_SOURCES`, and two registry comments point at CLI code that is going awayPosiblemente ocupada @shivamlalakiya la tomó hoy. Abiertobeginner documentation good first issue roadmap
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
PhilanthroPy-Project/PhilanthroPy#360 ·
Los mantenedores suelen responder en 1 día
-
beginner documentation good first issue roadmap
Dificultad 2/5 Medio día Aptitud para principiantes 68/100
PhilanthroPy-Project/PhilanthroPy#342 ·
Los mantenedores suelen responder en 1 día
-
beginner enhancement good first issue roadmap
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
PhilanthroPy-Project/PhilanthroPy#340 ·
Los mantenedores suelen responder en 1 día
Todos los issues de PhilanthroPy-Project/PhilanthroPy
Issues similares
-
community enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Hochfrequenz/sapgui.mcp#1039 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
didi/helixharness#18 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
API /search : typer la réponseAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
dataforgoodfr/democracy-watch#46 · 1 reacción ·