November 2017
Beginner
286 pages
8h 13m
English
We can read our project results data in, then use the R sample function to create our 2 two chunks of data (as trainingData and testData), as shown in the following R commands as follows:
# --- first load our project results data # --- from our CSV file into the object MyData MyData <- read.csv(file="c:/Worker/ProjectManagementProfit.csv", header=TRUE, sep=",") # --- next we are setting the ""sample seed"" # --- to reproduce results of random sampling set.seed(100) trainingRowIndex <- sample(1:nrow(MyData), 0.8*nrow(MyData)) # --- create our ""chunk"" of # --- model training data trainingData <- MyData [trainingRowIndex,] # --- create our ""chunk of # --- test data testData <- MyData [-trainingRowIndex,]
Read now
Unlock full access