response: a numeric vector, the response variable.
predictors: a numeric matrix or a data frame containing numeric and factor columns; the predictors.
sensitive: a numeric matrix or a data frame containing numeric and factor columns; the sensitive attributes.
unfairness: a vector of positive numbers in [0, 1], how unfair is the model allowed to be. The default value is seq(from = 0.00, to = 1, by = 0.02).
legend: a logical value, whether to add a legend to the plot.
type: a character string, either "coefficients" (the default), "constraints", "precision-recall" or "rmse".
model: a character string, the label of the model. Currently "nclm", "frrm", "fgrrm", "zlm" and "zlrm"
are available.
model.args: additional arguments passed to model estimation.
cluster: an optional cluster object from package parallel, to fit models in parallel.
Details
fairness.profile.plot() fits the model for all the values of the argument unfairness, and produces a profile plot of the regression coefficients or the proportion of explained variance.
If type = "coefficients", the coefficients of the model are plotted against the values of unfairness.
If type = "constraints", the following quantities are plotted against the values of unfairness:
For model "nclm", and model "frrm" with definition = "sp-komiyama":
the proportion of variance explained by the sensitive attributes (with respect to the response);
the proportion of variance explained by the predictors (with respect to the response);
the proportion of variance explained by the sensitive attributes (with respect to the combined sensitive attributes and predictors).
For model "frrm" with definition = "eo-komiyama":
the proportion of variance explained by the sensitive attributes (with respect to the fitted values);
the proportion of variance explained by the response (with respect to the fitted values);
the proportion of variance explained by the sensitive attributes (with respect to the combined sensitive attributes and response).
For model "frrm" with definition = "if-berk", the ratio between the individual fairness loss computed for a given values of the constraint and that of the unrestricted model with unfairness = 1.
For model "fgrrm": same as for "frrm" for each definition.
For models "zlm" and "zlrm": the correlations between the fitted values (from fitted() with type = "link") and the sensitive attributes.
If type = "precision-recall" and the model is a classifier, the precision, recall and F1 measures are plotted against the values of unfairness.
If type = "rmse" and the model is a linear regression, the residuals mean square error are plotted against the values of unfairness.
Returns
A trellis object containing a lattice plot.
Examples
data(vu.test)fairness.profile.plot(response = vu.test$gaussian, predictors = vu.test$X, sensitive = vu.test$S, type ="coefficients", model ="nclm", legend =TRUE)fairness.profile.plot(response = vu.test$gaussian, predictors = vu.test$X, sensitive = vu.test$S, type ="constraints", model ="nclm", legend =TRUE)fairness.profile.plot(response = vu.test$gaussian, predictors = vu.test$X, sensitive = vu.test$S, type ="rmse", model ="nclm", legend =TRUE)# profile plots fitting models in parallel.## Not run:library(parallel)cl = makeCluster(2)fairness.profile.plot(response = vu.test$gaussian, predictors = vu.test$X, sensitive = vu.test$S, model ="nclm", cluster = cl)stopCluster(cl)## End(Not run)