Reputation: 113
I'd like to ask how can I convert the final model that I get from a grid search with caret's 'train' function into an object of the class that is created with the glmnet function, assuming that I specified method='glmnet'.
Upvotes: 0
Views: 829
Reputation: 113
I'll answer myself (found it looking with different terms): the final model is saved in the train object as attribute 'finalModel', so if the train object is called 'fit', it can be accessed by fit$finalModel
Upvotes: 2