The elastic net is a regularized regression method that linearly combines the L1 and L2 penalties of the lasso and ridge methods. The loss function is given as below. I used cyclic coordinate descent algorithm to implement this regression method.
This is the source code file where I have implemented my own coordinate descent algorithm to solve least-squares regression with elastic net regularization.
This is the demo file that allows the user to launch ElasticNet method on a real world dataset(Hitters).
This is the demo file that allows the user to launch ElasticNet method on a real world dataset(Hitters).
This is the file that allows user to perform comparison between my implementation and scikit-learns ElasticNetCV on a real world dataset(Hitters)
To run the above files, clone this repo and make sure following packages are installed on the system.
- pandas
- numpy
- sklearn
- matplotlib.pyplot
- sklearn.cross_validation
- sklearn.linear_model.ElasticNet
- sklearn.linear_model.ElasticNetCV