civic_scorecard: Generate a full civic accountability scorecard

View source: R/civic_scorecard.R

civic_scorecardR Documentation

Generate a full civic accountability scorecard

Description

Synthesises model provenance, interpretability rating, performance, and equity into a printed civic accountability scorecard, with an optional JSON output. Works for all task types.

Usage

civic_scorecard(
  object,
  test_data,
  outcome,
  protected = NULL,
  positive = NULL,
  analyst = NULL,
  project = "civic.icarm",
  path = NULL
)

Arguments

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.

Value

Invisibly, a named list (the scorecard structure).

Examples

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")

civic.icarm documentation built on June 18, 2026, 1:06 a.m.