powered by
Uses the `ceterisParibus` package to compute counterfactuals for a given observation.
counterfactual_explain(object, observation, ...)
A counterfactual explanation object.
A `fastml` object.
A single observation (data frame with one row) to compute counterfactuals for.
Additional arguments passed to `ceterisParibus::calculate_counterfactuals`.
if (FALSE) { data(iris) iris <- iris[iris$Species != "setosa", ] iris$Species <- factor(iris$Species) model <- fastml(data = iris, label = "Species") counterfactual_explain(model, iris[1, ]) }
Run the code above in your browser using DataLab