# NOT RUN {
kcv = fairml.cv(response = vur.test$y, predictors = vur.test$X,
sensitive = vur.test$S, unfairness = 0.10, model = "nclm",
method = "k-fold", k = 10, runs = 10)
kcv
cv.loss(kcv)
cv.unfairness(kcv)
# run a second cross-validation with the same folds.
fairml.cv(response = vur.test$y, predictors = vur.test$X,
sensitive = vur.test$S, unfairness = 0.10, model = "nclm",
method = "custom-folds", folds = cv.folds(kcv))
# run cross-validation in parallel.
# }
# NOT RUN {
library(parallel)
cl = makeCluster(2)
fairml.cv(response = vur.test$y, predictors = vur.test$X,
sensitive = vur.test$S, unfairness = 0.10, model = "nclm",
method = "k-fold", k = 10, runs = 10, cluster = cl)
stopCluster(cl)
# }
Run the code above in your browser using DataLab