There are several methods that can be used for the quantile learning step in the fairadapt package. Each of the methods needs a specific constructor. The constructor is a function that takes the data (with some additional meta-information) and returns an object on which the computeQuants() generic can be called.

rangerQuants(data, A.root, ind, min.node.size = 20, ...)

linearQuants(
  data,
  A.root,
  ind,
  tau = c(0.001, seq(0.005, 0.995, by = 0.01), 0.999),
  ...
)

mcqrnnQuants(
  data,
  A.root,
  ind,
  tau = seq(0.005, 0.995, by = 0.01),
  iter.max = 500,
  ...
)

Arguments

data

A data.frame with data to be used for quantile regression.

A.root

A logical(1L) indicating whether the protected attribute A is a root node of the causal graph. Used for splitting the quantile regression.

ind

A logical vector of length nrow(data), indicating which samples have the baseline value of the protected attribute.

min.node.size

Forwarded to ranger::ranger().

...

Forwarded to further methods.

tau

Forwarded to quantreg::rq() or qrnn::mcqrnn.fit().

iter.max

Forwarded to qrnn::mcqrnn.fit().

Value

A ranger or a rangersplit S3 object, depending on the value of the A.root argument, for rangerQuants().

A rqs or a quantregsplit S3 object, depending on the value of the A.root argument, for linearQuants().

An mcqrnn S3 object for mcqrnnQuants().

Details

Within the package, there are 3 different methods implemented, which use quantile regressors based on linear models, random forests and neural networks. However, there is additional flexibility and the user can provide her/his own quantile method. For this, the user needs to write (i) the constructor which returns an S3 classed object (see examples below); (ii) a method for the computeQuants() generic for the S3 class returned in (i).

The rangerQuants() function uses random forests (ranger package) for quantile regression.

The linearQuants() function uses linear quantile regression (quantreg package) for the Quantile Learning step.

The mcqrnnQuants() function uses monotone quantile regression neural networks (mcqrnn package) in the Quantile Learning step.