syn.rf: Synthesis with random forest

View source: R/functions.syn.r

syn.rfR Documentation

Synthesis with random forest

Description

Generates univariate synthetic data using Breiman's random forest algorithm classification and regression. It uses randomForest function from the randomForest package.

Usage

syn.rf(y, x, xp, smoothing = "", proper = FALSE, ntree = 10, ...)

Arguments

y

an original data vector of length n.

x

a matrix (n x p) of original covariates.

xp

a matrix (k x p) of synthesised covariates.

smoothing

smoothing method for numeric variable. See syn.smooth.

proper

for proper synthesis (proper = TRUE) a model is fitted to a bootstrapped sample of the original data.

ntree

number of trees to grow.

...

additional parameters passed to randomForest.

Details

...

Value

A list with two components:

res

a vector of length k with synthetic values of y.

fit

the fitted model which is an object of class randomForest.

References

...

See Also

syn, syn.rf, syn.bag, syn.cart, randomForest, syn.smooth


bnowok/synthpop documentation built on Sept. 1, 2022, 2:41 p.m.