Learn R Programming

npsm (version 2.0.0)

sim_class2: A simulated classification example with two variables and two classes (labels).

Description

A simulated classification example with two variables and two classes (labels).

Usage

data("sim_class2")

Arguments

Format

A data frame with 1000 observations on the following 4 variables.

train

an indicator for training and test sets

x1

an explantory variable

x2

an explantory variable

y

response variable - a factor with levels 0 1

Details

Random points in the x1,x2 plane were generated. Class labels based on location relative to two circles in the x1,x2 plane with some random variation in the labels simulated.

Examples

Run this code
data(sim_class2)
dim(sim_class2)

train_set <- sim_class2[sim_class2$train==1,]
dim(train_set)

with(train_set,plot(x1,x2,main='Training Set',cex=0.625))
with(train_set,points(x1,x2,main='Training Set',pch=20,col=y,cex=0.625))


Run the code above in your browser using DataLab