Thanks for the distinction between dual and primal. Now I understand what I
was doing wrong.

G.

On Tue, Nov 18, 2014 at 11:57 AM, Michael Eickenberg <
michael.eickenb...@gmail.com> wrote:

> dual=True / False does not change the result, only potentially the speed
> of the algorithm
>
> With an L2 penalty, dual=True is preferable when n_samples < n_features,
> dual=False (i.e. "primal=True") is preferable when n_features < n_samples
>
> With an L1 penalty, dual=True is simply not implemented.
>
> So, if you are searching over penalty=["L1", "L2"] and have n_samples <
> n_features then you will have to provide separate dictionaries if you want
> to make use of the speedup from dual=True in the L2 case.
>
> Michael
>
> On Tue, Nov 18, 2014 at 5:52 PM, Andy <t3k...@gmail.com> wrote:
>
>>  Hi George.
>>
>> A way to avoid the error is by using lists of grids, where each grid only
>> has valid combinations
>>
>> param_grid = [{'dual': False, 'penalty': 'l1', 'C': 10. ** np.arange(-3,
>> 3)}, {'dual': True, 'penalty':'l2', 'loss': 'l2', 'C': : 10. **
>> np.arange(-3, 3)}]
>>
>> or something like that. (Look up the allowed combination in the docs, I
>> don't know them by heart ;)
>>
>> What are you searching over? Searching over whether to use the dual or
>> not does not really make much sense to me.
>>
>> Best,
>> Andy
>>
>>
>>
>> On 11/18/2014 11:41 AM, George Bezerra wrote:
>>
>>  I'm trying to perform a grid search cv for logistic regression but I
>> stumble on invalid combination of parameters:
>>
>>  ValueError: Unsupported set of arguments: penalty='l1' is only supported
>> when dual='false'., Parameters: penalty='l1', loss='lr', dual=True
>>
>>  Is there a way to avoid this problem?
>>
>>  Thanks,
>>
>>  George.
>>
>>  --
>> George Bezerra
>>
>>
>> ------------------------------------------------------------------------------
>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>> Get technology previously reserved for billion-dollar corporations, 
>> FREEhttp://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
>>
>>
>>
>> _______________________________________________
>> Scikit-learn-general mailing 
>> listScikit-learn-general@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>> Get technology previously reserved for billion-dollar corporations, FREE
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Scikit-learn-general mailing list
>> Scikit-learn-general@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>>
>>
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> _______________________________________________
> Scikit-learn-general mailing list
> Scikit-learn-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
>


-- 
George Bezerra
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to