-train function does not subset the dataset

Using the train function, I am trying to create two sub-datasets. My original dataset has 2215 observations (UCI_CC_cleaned). Using the code below, I could create the training dataset (UCI.train) with 575 observations, but the test dataset does not have the correct dimensions. I am expecting 2215-575 observations, but it contains 2214 observations.

   train <- UCI_CC_cleaned$random >0.75
          UCI.train <- UCI_CC_cleaned[train, ]
  UCI.test <- UCI_CC_cleaned[-train, ]


from Recent Questions - Stack Overflow https://ift.tt/345pZgE
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation