View source: R/civic_scorecard.R
| civic_scorecard | R Documentation |
Synthesises model provenance, interpretability rating, performance, and equity into a printed civic accountability scorecard, with an optional JSON output. Works for all task types.
civic_scorecard(
object,
test_data,
outcome,
protected = NULL,
positive = NULL,
analyst = NULL,
project = "civic.icarm",
path = NULL
)
object |
A 'civic_model'. |
test_data |
Data frame of held-out test data. |
outcome |
Character. Outcome column name. |
protected |
Character. Protected attribute column (optional). |
positive |
Positive class (binary only). |
analyst |
Character analyst name. |
project |
Character project name. |
path |
Optional file path for JSON output. |
Invisibly, a named list (the scorecard structure).
splits <- civic_split(civic_voting, stratify = "voted")
m <- civic_fit(voted ~ age + education + political_interest, splits$train)
civic_scorecard(m, splits$test, outcome = "voted",
protected = "gender", positive = "yes",
project = "DataCitizen-Pro")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.