fairTwins {fairadapt} | R Documentation |
Fair Twin Inspection convenience function.
Description
Fair Twin Inspection convenience function.
Usage
fairTwins(x, train.id = seq_len(nrow(x$train)), test.id = NULL, cols = NULL)
Arguments
x |
Object of class |
train.id |
A vector of indices specifying which rows of the training data should be displayed. |
test.id |
A vector of indices specifying which rows of the test data should be displayed. |
cols |
A |
Value
A data.frame
, containing the original and adapted values
of the requested individuals. Adapted columns have _adapted
appended
to their original name.
Examples
n_samp <- 200
uni_dim <- c( "gender", "edu", "test", "score")
uni_adj <- matrix(c( 0, 1, 1, 0,
0, 0, 1, 1,
0, 0, 0, 1,
0, 0, 0, 0),
ncol = length(uni_dim),
dimnames = rep(list(uni_dim), 2),
byrow = TRUE)
uni_ada <- fairadapt(score ~ .,
train.data = head(uni_admission, n = n_samp),
test.data = tail(uni_admission, n = n_samp),
adj.mat = uni_adj,
prot.attr = "gender"
)
fairTwins(uni_ada, train.id = 1:5)
[Package fairadapt version 0.2.7 Index]