| predict.fairadaptBoot | R Documentation |
fairadaptBoot objectPrediction function for new data from a saved fairadaptBoot object
## S3 method for class 'fairadaptBoot'
predict(object, newdata, ...)
object |
Object of class |
newdata |
A |
... |
Additional arguments forwarded to |
The newdata argument should be compatible with adapt.test
argument that was used when constructing the fairadaptBoot object. In
particular, newdata should contain column names that appear in the
formula argument that was used when calling fairadaptBoot() (apart from
the outcome variable on the LHS of the formula).
A data.frame containing the adapted version of the new data.
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_boot <- fairadaptBoot(score ~ .,
train.data = head(uni_admission, n = n_samp),
adj.mat = uni_adj,
prot.attr = "gender",
n.boot = 5,
keep.object = TRUE
)
predict(object = uni_ada_boot, newdata = tail(uni_admission, n = n_samp))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.