Data Science, Machine Learning, Data Analytics, Knowledgebase Analytics, Regularization.
"scale"), # Normalize (center and scale) the data metric = "RMSE" ) # Coefficients Plot coef <- as.matrix(coef(elasticNetModel$finalModel, s = elasticNetModel$bestTune$lambda)) coef <- coef[coef != 0, , drop = FALSE] # Remove zero coefficients # Remove the intercept coef <- coef[-1, , drop = FALSE]