I am using the wisconsin dataset which has two categorical columns IDs
and class
. In order to carry out classification I must drop these two columns from the dataframe and then split the dataset into train and test (80%:20%). I have this done but now I want to merge the corresponding class to the split datasets.
Then I have to put the split classes into a new vector.
example:
data <- read.csv("data.csv")
data <-data[,-1] #drop IDs
data <-data[,-10] #drop class
X <-data.frame((scale(data)))
dt = sort(sample(nrow(X), nrow(X)*8))
training <-X[dt,]
test<-X[-dt,]
From here I need to merge the class corresponding to the sample.