# NOT RUN {
dataset <- friedman1 # Load dataset.
set.seed(1234)
# Prepare the data.
split1 <- split_train_test(dataset, pctTrain = 70)
split2 <- split_train_test(split1$trainset, pctTrain = 5)
L <- split2$trainset
U <- split2$testset[, -11]
testset <- split1$testset
regressors <- list(knn = caret::knnreg)
model <- ssr("Ytrue ~ .", L, U, regressors = regressors, testdata = testset, maxits = 10)
# Plot the RMSE of the fitted model.
plot(model, metric = "rmse", ptype = 1)
# Plot the MAE.
plot(model, metric = "mae", ptype = 1)
# }
Run the code above in your browser using DataLab