Skip to content

GibbsG/GeneticCF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GeneticCF: Using Counterfactual Explanations in Generating Rule-based Explanations

To run GeneticCF, you need to have Julia installed (link). Then you can run the following commands to load the package GeCo, which we used as the underneath counterfactual explanation system.

using Pkg; Pkg.activate("./GeCo")
using GeCo

We provide scripts to load the data and model. For instance:

include("scripts/credit/credit_setup_MACE.jl");
include("scripts/adult/adult_setup_MACE.jl");
include("../scripts/fico/fico-setup.jl")

Then run the following command to compute the rule-based explanations:

explanations, = generate_rules(orig_instance, X, classifier, plaf)

for GeneticRule;

explanations, = generate_rules(orig_instance, X, classifier, plaf, geco_initial = true, geco_mutation = true)

for RuleCF;

explanation, = greedyCF(orig_instance, X, classifier, plaf)

for RuleCFGreedy, where orig_entity is the entity to be explained, X is the dataset, classifier is the model that is explained, and plaf is the PLAF constrains.

To print out the top rule:

explanation = explanations[1]
print_rule(orig_instance, explanation)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages