Displaying 1 result from an estimated 1 matches for "crankshawtrain".
2018 Feb 24
3
Regression Tree Questions
...equired package: lattice
Loading required package: ggplot2
Warning messages:
1: package ?caret? was built under R version 3.4.3
2: package ?ggplot2? was built under R version 3.4.3
> library(rattle)
> n <- nrow(Crankshaw)
> train <- sample(1:n, size = 0.5 * n, replace = FALSE)
> CrankshawTrain <- Crankshaw[train, ]
> temp <- (1:n)[-train]
> val <- sample(temp, size = (0.3 / 0.5) * length(temp), replace = FALSE)
> CrankshawVal <- Crankshaw[val, ]
> test <- (1:n)[-c(train, val)]
> CrankshawTest <- Crankshaw[test, ]
> model <- rpart(`Selling Price ($)`...