Tarea Nro 9 Diego Vasquez
Tarea Nro 9 Diego Vasquez
Tarea Nro 9 Diego Vasquez
> library(caret)
Loading required package: ggplot2
Loading required package: lattice
Entrenando el dataset
> RNGkind(sample.kind = "Rejection")
> train.cont <- trainControl(method = "cv", number = 10)
263 samples
8 predictor
No pre-processing
Resampling: Cross-Validated (10 fold)
Summary of sample sizes: 235, 237, 237, 237, 238, 236, ...
Resampling results:
263 samples
12 predictor
No pre-processing
Resampling: Cross-Validated (10 fold)
Summary of sample sizes: 236, 236, 236, 237, 235, 236, ...
Resampling results:
# Valor semilla
> set.seed(654)
> m6 <- train(Salary ~ CHmRun + Runs + Walks CAtBat + CHits + Division + PutOuts, data = Hitters, method =
"lm",
Error: unexpected symbol in "m6 <- train(Salary ~ CHmRun + Runs + Walks CAtBat"
> m6 <- train(Salary ~ CHmRun + Runs + Walks + CAtBat + CHits + Division + PutOuts, data = Hitters, method
= "lm",
+ trControl = train.cont)
> m6
Linear Regression
263 samples
7 predictor
No pre-processing
Resampling: Cross-Validated (10 fold)
Summary of sample sizes: 238, 236, 237, 236, 237, 236, ...
Resampling results: