Calls adversarial_rf, forde and forge.
For repeated application, it is faster to save outputs of adversarial_rf
and forde and pass them via ... or directly use forge.
Arguments
- x
Input data. Integer variables are recoded as ordered factors with a warning. See Details.
- n_synth
Number of synthetic samples to generate for unconditional generation with no
evidencegiven. Number of synthetic samples to generate perevidencerow ifevidenceis provided. IfNULL, defaults tonrow(x)if noevidenceis provided and to1otherwise.- ...
Extra parameters to be passed to
adversarial_rf,fordeandforge.
Value
A dataset of n_synth synthetic samples or of nrow(x) synthetic
samples if n_synth is undefined.
References
Watson, D., Blesch, K., Kapar, J., & Wright, M. (2023). Adversarial random forests for density estimation and generative modeling. In Proceedings of the 26th International Conference on Artificial Intelligence and Statistics, pp. 5357-5375.
Examples
# Generate 150 (size of original iris dataset) synthetic samples from the iris dataset
x_synth <- rarf(iris)
# Generate 100 synthetic samples from the iris dataset
x_synth <- rarf(iris, n_synth = 100)
# Condition on Species = "setosa"
x_synth <- rarf(iris, evidence = data.frame(Species = "setosa"))
