gendat_percep: Generate Linearly Separable Data Based on the Perceptron...

Description Usage Arguments Details Author(s) Examples

View source: R/gendat.R

Description

Generates data that can be classified as +1 or -1 based on a linear classifier defined by a vector of weights w.

Usage

1

Arguments

n

Sample size.

w

A vector of weights defining the linear classifier. The first element of the vector is the bias parameter b.

...

Arguments to pass to FUN.

Details

Randomly generates the data matrix \mathbf{X} and vector \mathbf{y} using a threshold function: if \mathbf{X}_{n \times k} \mathbf{w}_{k \times 1} > 0 then \mathbf{y}_{n \times 1} = +1 and if \mathbf{X}_{n \times k} \mathbf{w}_{k \times 1} < 0 then \mathbf{y}_{n \times 1} = -1.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

1
2
3
4
5
6
7
data <- gendat_percep(
  n = 100,
  w = c(.5, .5, .5),
  rFUN_X = rnorm,
  mean = 0,
  sd = 1
)

jeksterslabds/jeksterslabRds documentation built on July 16, 2020, 3:41 p.m.