scikit-learn-contrib / lightning

Large-scale linear classification, regression and ranking in Python
https://contrib.scikit-learn.org/lightning/
1.73k stars 214 forks source link

'CDRegressor' object has no attribute 'kernel' #9

Closed pprett closed 10 years ago

pprett commented 10 years ago

This popped up when I ran a CDRegressor(warm_start=True, permute=True, penalty="l1")::

_lasso_fx_selection
    est.fit(X, y)
  File "/usr/local/lib/python2.7/dist-packages/lightning/impl/primal_cd.py", line 430, in fit
    if self.kernel:
AttributeError: 'CDRegressor' object has no attribute 'kernel'
mblondel commented 10 years ago

Fixed, thanks for the bug report.

Please give me some feed back about the warm_start option. I haven't tested it much.

pprett commented 10 years ago

Hi Mathieu,

thanks for fixing so fast - I just wanted to work on it at the airport. I looked into lightning because I found the LASSO in scikit-learn quite slow (esp. compared to liblinear with l1 penalty). Lightning's CDRegressor is (at least) an order of magnitude faster than sklearn's LASSO on my benchmarks (~15K n_samples and 5K n_features - sparse

One thing I noticed: in sklearn, warm_start=True gives hardly a performance increase for subsequent alpha's (computing largest to smallest). For lightning the saving is considerable (for a 25 point path ~ 70% is spent on the first and 30% on the other 24).

Great work on that! I really need to read-up on coordinate descent algorithms - I don't trust sklearn's SGDRegressor too much ;)

best, Peter

2014-04-04 10:15 GMT-04:00 Mathieu Blondel notifications@github.com:

Fixed, thanks for the bug report.

Please give me some feed back about the warm_start option. I haven't tested it much.

Reply to this email directly or view it on GitHubhttps://github.com/mblondel/lightning/issues/9#issuecomment-39569165 .

Peter Prettenhofer