# How to use weights with Elasticnet regression in python?

I am using Elasticnet from scikit-learn in python, I've also used Glmnet package in R for prototyping. I want to use weights in Elasticnet which apparently is not available as an option/argument in Elasticnet in scikit-learn. However it is available in glmnet/elnet in R.

Has anyone used weights with elasticnet in python? Any insight on how it can be done.

• glmnet supports weights for both samples, and for various predictors to increase or decrease the regularization strength on a by-variable basis. Which are you asking about? – Matthew Drury Jul 29 '16 at 0:23
• I was asking about sample, My sample had dates and I wanted to assign lower weight to older data wrt to newer data. I achieved it to some extent by duplicating records for newer dates. – Ashish Singhal Dec 7 '16 at 18:21