https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/linear_model/least_angle.py

It looks like that's alpha_min=0 by default in master, so it should be fixed.

--
Cp


On Fri, Jun 29, 2012 at 9:05 AM, Alexandre Gramfort
<[email protected]> wrote:
> you should be able to call lars_path with min alpha=0
>
> see :
>
> https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/linear_model/tests/test_least_angle.py#L57
>
> Alex
>
> On Fri, Jun 29, 2012 at 1:40 AM, Charles-Pierre Astolfi <[email protected]> 
> wrote:
>> Btw, let
>>
>>>>> alphas, _, coefs = lars_path(X, y)
>>
>> Wouldn't it be nice to have 0 in alphas ? (with the plain linear
>> regression as its coefs).
>> That would make interpolation implementation more straightforward, and
>> that way, the regularization path would be totally defined.
>> As of now, it is not possible to tell directly the solution of Lasso
>> between zero and min(alpha).
>>
>> That'd make another PR I guess :)
>>
>> --
>> Cp
>>
>>
>> On Thu, Jun 28, 2012 at 10:01 PM, Alexandre Gramfort
>> <[email protected]> wrote:
>>> +1
>>>
>>> look for interpolate in least_angle.py to see where we already use the
>>> linear interpolation
>>>
>>> Alex
>>>
>>> On Thu, Jun 28, 2012 at 6:42 PM, Olivier Grisel
>>> <[email protected]> wrote:
>>>> 2012/6/28 Charles-Pierre Astolfi <[email protected]>:
>>>>> Hi scikiters,
>>>>>
>>>>> I am trying to compute lasso/lars for several values of the
>>>>> regularization parameter.
>>>>>
>>>>> A clean way to do this, is like this:
>>>>>>>> alphas = [some long list of positive values]
>>>>>>>> models = linear_model.lars_path(X, y, alphas=alphas)
>>>>
>>>> Nope you cannot path the list of alphas to `lars_path` as it will
>>>> automatically find the relevant inflection points analytically, see
>>>> for instance this example :
>>>>
>>>> http://scikit-learn.org/stable/auto_examples/linear_model/plot_lasso_lars.html
>>>>
>>>>> Unfortunately, it seems to be very slow, compared to lars_path +
>>>>> manual interpolation on each alpha.
>>>>
>>>> Ok so in the previous comment you probably meant lasso_path instead of
>>>> lars_path. As in:
>>>>
>>>> http://scikit-learn.org/stable/auto_examples/linear_model/plot_lasso_coordinate_descent_path.html
>>>>
>>>>> My understanding is that it is
>>>>> because the returned model is an ElasticNet and, as such, cannot use
>>>>> lars regularization path to efficiently compute the solutions for
>>>>> several alphas.
>>>>
>>>> Yes it is an iterated Coordinate Descent optimization of the LASSO
>>>> objective function rather than a LASSO/LARS optimizer but it does warm
>>>> restarts so it should still be competitive with LARS. However I think
>>>> that the convergence checks in the current implementation are
>>>> expensive right now so fine grids my still be expensive. There are two
>>>> ongoing GSoC projects that might fix this perf issue at some point.
>>>>
>>>>> Am I missing something?
>>>>
>>>> You might now be aware that the Lasso CD optimization is very
>>>> expensive when alpha is getting very small. Try to truncate your
>>>> alphas list down to the smallest values that are still easy to
>>>> optimize for.
>>>>
>>>>> If I need speed, should I interpolate myself?
>>>>
>>>> It's probably a good idea and could be a nice new feature to
>>>> contribute to scikit-learn.
>>>>
>>>>> Is it worth a pull request?
>>>>
>>>> Sure :)
>>>>
>>>> --
>>>> Olivier
>>>> http://twitter.com/ogrisel - http://github.com/ogrisel
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Live Security Virtual Conference
>>>> Exclusive live event will cover all the ways today's security and
>>>> threat landscape has changed and how IT managers can respond. Discussions
>>>> will include endpoint security, mobile security and the latest in malware
>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>>> _______________________________________________
>>>> Scikit-learn-general mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>>>
>>> ------------------------------------------------------------------------------
>>> Live Security Virtual Conference
>>> Exclusive live event will cover all the ways today's security and
>>> threat landscape has changed and how IT managers can respond. Discussions
>>> will include endpoint security, mobile security and the latest in malware
>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>> _______________________________________________
>>> Scikit-learn-general mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Scikit-learn-general mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Scikit-learn-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to