I'm building several models. My large Knn, ada and nn models are not saving as variables after they are trained. My glm, and dtree models do save. When I open R Studio again, I have to rerun the models which takes hours. Here is an example knn model.
Cross validation 10-fold CV
cross_validation <- trainControl(method = "repeatedcv",
number = 10,
repeats = 3)
Hyper-parameter tuning
Param_Grid <- expand.grid(k = 1:10)
fit the model to training data
Knn_prev <- train(HN_data_x_train_prev_norm,
HN_data_y_train_1,
method = "knn",
tuneGrid = Param_Grid,
trControl = cross_validation)