View source: R/civic_scorecard.R
| civic_compare | R Documentation |
Evaluates a named list of 'civic_model' objects on a common test set and returns a tidy comparison table of performance, fairness, and interpretability. All models must have the same task type.
civic_compare(
models,
test_data,
outcome,
protected = NULL,
positive = NULL,
threshold = 0.5
)
models |
A **named** list of 'civic_model' objects, e.g. 'list(CART = m1, Logistic = m2)'. |
test_data |
A data frame used for all evaluations. |
outcome |
Character. Outcome column name. |
protected |
Character. Protected attribute column (optional). Pass 'NULL' to skip fairness metrics. |
positive |
Positive class level (binary only). |
threshold |
Decision threshold (binary only, default '0.5'). |
A tibble of class 'civic_comparison'.
splits <- civic_split(iris, stratify = "Species")
m1 <- civic_fit(Species ~ ., splits$train, model = "cart")
m2 <- civic_fit(Species ~ ., splits$train, model = "multinomial")
cmp <- civic_compare(list(CART = m1, Multinomial = m2),
splits$test, outcome = "Species")
civic_plot_comparison(cmp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.