Learn R Programming

tidysynthesis (version 0.1.2)

noise: Create a noise object

Description

Create a noise object

Usage

noise(add_noise = FALSE, mode = "regression", noise_func = NULL, ...)

Value

A noise object

Arguments

add_noise

Boolean, TRUE if adding noise

mode

String, one of "regression" or "classification"

noise_func

A function that adds noise to

...

Optional named additional arguments to pass to noise_func(...)

Examples

Run this code

# create default noise object
noise()

# create noise object for classification
noise(
  add_noise = TRUE,
  mode = "classification",
  noise_func = add_noise_cat_unif
)

# create noise object for regression
noise(
  add_noise = TRUE,
  mode = "regression",
  noise_func = add_noise_kde,
  n_ntiles = 10
)

Run the code above in your browser using DataLab