This function uses a high-dimensional ARF model to generate synthetic data.
Arguments
- harf_obj
A pre-trained harf model.
- n_synth
Number of synthetic samples to generate.
- evidence
Optional set of conditioning events. This will be further passed to the
fordefunction in each isolated regions. Seefordefor details.- omx_onset_data
Optional data.frame of conditional onset omics features.
- evidence_row_mode
Interpretation of rows in multi-row evidence. See
fordefor details.- round
Round continuous variables to their respective maximum precision in the real data set? See
fordefor details.- sample_NAs
Sample NAs respecting the probability for missing values in the original data? See
fordefor details.- nomatch
What to do if no leaf matches a condition in evidence? Options are to force sampling from a random leaf ("force") or return NA ("na"). The default is "force".
- verbose
What to do if no leaf matches a condition in
evidence? Seefordefor details.- stepsize
How many rows of evidence should be handled at each step? See
fordefor details.- parallel
Compute in parallel? See
fordefor details.
References
Watson et al. (2023). Adversarial Random Forests. Proceedings of the International Conference on Machine Learning (PMLR 206). https://proceedings.mlr.press/v206/watson23a.html
Fouodo et al. (2026). High-Dimensional Adversarial Random Forests. Submitted / under review.
See also
forge for details on the forging process.
Examples
# \donttest{
data(single_cell)
harf_model <- h_arf(
omx_data = single_cell[ , - which(colnames(single_cell) == "cell_type")],
cli_lab_data = data.frame(cell_type = single_cell$cell_type)
)
# Unconditional sampling from harf_model
set.seed(123)
synth_single_cell <- h_forge(
harf_obj = harf_model,
n_synth = nrow(single_cell)
)
#> Generating synthetic data for cluster 1 out of 12...
#> Generating synthetic data for cluster 2 out of 12...
#> Generating synthetic data for cluster 3 out of 12...
#> Generating synthetic data for cluster 4 out of 12...
#> Generating synthetic data for cluster 5 out of 12...
#> Generating synthetic data for cluster 6 out of 12...
#> Generating synthetic data for cluster 7 out of 12...
#> Generating synthetic data for cluster 8 out of 12...
#> Generating synthetic data for cluster 9 out of 12...
#> Generating synthetic data for cluster 10 out of 12...
#> Generating synthetic data for cluster 11 out of 12...
#> Generating synthetic data for cluster 12 out of 12...
# Conditional resampling from harf_model
set.seed(142)
lung_single_cell <- h_forge(
harf_obj = harf_model,
n_synth = sum(single_cell$cell_type == "lung"),
evidence = data.frame(cell_type = "lung")
)
#> Generating synthetic data for cluster 1 out of 12...
#> Generating synthetic data for cluster 2 out of 12...
#> Generating synthetic data for cluster 3 out of 12...
#> Generating synthetic data for cluster 4 out of 12...
#> Generating synthetic data for cluster 5 out of 12...
#> Generating synthetic data for cluster 6 out of 12...
#> Generating synthetic data for cluster 7 out of 12...
#> Generating synthetic data for cluster 8 out of 12...
#> Generating synthetic data for cluster 9 out of 12...
#> Generating synthetic data for cluster 10 out of 12...
#> Generating synthetic data for cluster 11 out of 12...
#> Generating synthetic data for cluster 12 out of 12...
# }