rxor: Random XOR Samples

Description Usage Arguments Details Value Author(s) Examples

Description

Data is generated for the XOR problem. The default settings produce a data.frame with columns x1, x2 and y and with 4 rows and this table defines the XOR problem. The output y is defined by the XOR operation applied to the Boolean x1 and x2.

Usage

1
rxor(n = 1, p = 0)

Arguments

n

sample size is 4*n

p

extra random inputs, x3, x4, ... etc. So the output data frame has dimensions 4*n by 2+p+1 columns. The extra p columns are random Bernouilli random variables with equi-probable outcomes.

Details

This was a famous problem in online learning.

Value

data.frame with 4*n rows and 2+p+1 columns. The last column corresponds to the output.

Author(s)

A. I. McLeod

Examples

1
2
3
library("C50")
Xy <- rxor(n=5, p=2)
C5.0(y ~ ., data=Xy)

Example output

Call:
C5.0.formula(formula = y ~ ., data = Xy)

Classification Tree
Number of samples: 20 
Number of predictors: 4 

Tree size: 6 

Non-standard options: attempt to group attributes

gencve documentation built on May 2, 2019, 6:08 a.m.