sim_response_xy: Generate data sets to apply binary classifiers

View source: R/response_xy.R

sim_response_xyR Documentation

Generate data sets to apply binary classifiers

Description

Generate data sets to apply binary classifiers

Usage

sim_response_xy(
  n = 500,
  x_dist = purrr::partial(runif, min = -1, max = 1),
  y_dist = x_dist,
  relationship = function(x, y) x > y,
  noise = 0.2
)

Arguments

n

An integer

x_dist

A random number generation function.

y_dist

A random number generation function.

relationship

A function specify the relationship between x, y and the response. A function f(x, y) need return a logical value.

noise

A number between 0 and 1.

Examples


set.seed(123)

df <- sim_response_xy(n = 500)

df

plot(df)


jbkunst/klassets documentation built on Dec. 7, 2022, 9:18 p.m.