Skip to content
Snippets Groups Projects
Commit 63a97e1a authored by Carl Corder's avatar Carl Corder
Browse files

Update train_models.r

parent 216c857f
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@ validation.data <- data[-training.index, ]
# k-fold cross validation
control <- trainControl(method = "cv", number = 10)
# metric for evaluate model
# metric for evaluating model
metric <- "Rsquared"
# RF: Random Forest
......@@ -32,4 +32,5 @@ fit.rf <- train(RTN ~ ., data = training.data, method = "rf", metric = metric, t
# kNN: k-Nearest Neighbors
fit.knn <- train(RTN ~ ., data = training.data, method = "knn", metric = metric, trControl = control)
# save model to disk
save(fit.rf, fit.knn, training.index, file = "model.RData")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment