'Set number of folds in glmnet in python?

I am using glment python package to fit an Elastic Net model. I want to set my preferred number of folds for cross-validation that in python I'd achieve as: regr = ElasticNetCV(cv=5). Yet glmnet does not seem to have the same argument, i.e. model = glmnet.ElasticNet(cv = 5) gives an error "TypeError: init() got an unexpected keyword argument 'cv'" Is there a way to set the number of cross-validation fold in glmnet in python?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source