Search code examples
scikit-learnlasso-regression

What is the role of the parameter 'selection' in sklearn.linear_model.Lasso


I wonder the role of the parameter 'selection' in the sklearn function sklearn.linear_model.Lasso.

I guess this parameter set the optimization way of Lasso solver, but I want to know exactly how it is works. I read the docs of this, but I didn't catch up this perfectly.

Could you explain this?

What is the different between selection = 'cyclic' and selection = 'random' ?


Solution

  • The difference is between coordinate descent and random coordinate descent. In every iteration it cycles through features (i.e. coordinates) one at a time, minimizing the cost function with respect to each coordinate.

    Regular coordinate descent cycles through all features: enter image description here

    Randomized chooses each feature at random: enter image description here

    Here's it in sklearn.