compare_regression_models.Rd
This function compares different regression models by calculating their mean squared error (MSE)
compare_regression_models(
data,
x_vars,
y_var,
new_data,
lambda = 1,
alpha = 1,
max_iter = 1000,
tol = 1e-04,
degree = 2,
k = 5
)
A data frame containing the data to fit the models
A character vector of predictor variable names
A character string of the response variable name
A data frame containing the data for making predictions
A numeric value for the ridge and lasso regularization parameter (default 1)
A numeric value for the lasso mixing parameter (default 1)
A numeric value for the maximum number of iterations for lasso (default 1000)
A numeric value for the tolerance for lasso convergence (default 1e-4)
A numeric value for the polynomial regression degree (default 2)
A numeric value for the number of neighbors for kNN regression (default 5)
A data frame showing the models and their corresponding MSE values, sorted by smallest MSE