Comments (4)
Coordinate descent is known to converge slowly for very loosely regularized problems (small alpha). alpha=0.01
doesn't seem small on first sight but it could be for that particular problem. One way to check is to plot test MSE as a function of alpha. The plot should have a bell shape (too regularized = underfit, loosely regularized = overfit). Perhaps alpha=0.01
will be in the overfit region.
That said the oscillating effect is a bit strange so this could be a bug. I would be curious how the scikit-learn or liblinear solvers behave on the same data.
Also, does the problem only occur with L2 regularization or also with L1 regularization?
from lightning.
@mblondel I confirm, the solver terminates much quicker with L1 penalty, however, I can see some oscillation there too -- especially once I set tol
very low:
In [23]: est = CDClassifier(C=10.0, alpha=1.0, random_state=0, penalty="l1", loss="log", verbose=3, max_iter=25, tol=0.000001) In [24]: est.fit(bin_dense[:10000,:], bin_target[:10000]) Iteration 0 . Active size: 100 Violation sum ratio: 1.000000 (tol=0.000000) Iteration 1 . Active size: 100 Violation sum ratio: 0.119174 (tol=0.000000) Iteration 2 . Active size: 100 Violation sum ratio: 0.016049 (tol=0.000000) Iteration 3 . Active size: 100 Violation sum ratio: 0.002891 (tol=0.000000) Iteration 4 . Active size: 100 Violation sum ratio: 0.000715 (tol=0.000000) Iteration 5 . Active size: 100 Violation sum ratio: 0.000306 (tol=0.000000) Iteration 6 . Active size: 100 Violation sum ratio: 0.000166 (tol=0.000000) Iteration 7 . Active size: 100 Violation sum ratio: 0.000043 (tol=0.000000) Iteration 8 . Active size: 100 Violation sum ratio: 0.000030 (tol=0.000000) Iteration 9 . Active size: 100 Violation sum ratio: 0.000013 (tol=0.000000) Iteration 10 . Active size: 100 Violation sum ratio: 0.000008 (tol=0.000000) Iteration 11 . Active size: 100 Violation sum ratio: 0.000008 (tol=0.000000) Iteration 12 . Active size: 100 Violation sum ratio: 0.000011 (tol=0.000000)
from lightning.
liblinear (sklearn LogisticRegression) w/ L2 penalty terminates after 4 iterations.
from lightning.
I pushed b07bf03 which I believe should fix or improve the situation. The L2 solver now uses the same stopping criterion as other solvers. Also you can now use termination="violation_sum"
or termination="violation_max"
. On my laptop, the solver now stops in ~5 iterations with tol=1e-3
, ~10 iterations with tol=1e-4
and ~30 iterations with tol=1e-5
.
from lightning.
Related Issues (20)
- Unsafe screening with CDClassifier? HOT 1
- Forgotten intercept in SGDRegressor HOT 2
- ModuleNotFoundError: No module named 'sklearn.externals.six' HOT 4
- How to pip sklearn-contrib-lightning HOT 2
- 2d errors when passing pandas DataFrame/Series
- Nonnegative penalties actually allowed in CDRegressors HOT 3
- FistaRegressor does not converge for real data HOT 3
- build pb on python 3.9 HOT 1
- Change assert imports HOT 2
- do you have Quantile Regression for spars data after one hot transformation
- do you have Regression for spars categorical big data after one hot transformation
- do you have support vector regression with soft margin and confidence interval ?
- do you have implementation for regression with confidence intervals ?
- Does lightning natively support multi-label HOT 1
- DOC: sometimes the Lasso solution is the same as sklearn, sometimes not HOT 5
- install help
- ENH - Add support of intercept in ``SDCARegressor`` HOT 1
- Why not initialize SAG/SAGA memory with 0 and divide by seen indices so far as in sklearn?
- Missing Support for class-weights specifications to tacke Disproportionate Number of Samples between dependent variable classes
- CDClassifier : error for penalty="l1" and penalty="l2", but no error for penalty="l1/l2" HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightning.