Re: [scikit-learn] Using fit_intercept with sparse matrices

2016-07-05 Thread Vlad Niculae
For example I use fit_intercept=False when training SVMRank-style models where inputs are pairwise differences (x_i - x_j), I[y_i > y_j]. In this setting it's actually incorrect to learn an intercept. On Tue, Jul 5, 2016 at 3:46 AM, Gael Varoquaux wrote: >> > Jaidev is suggesting that fit_interce

Re: [scikit-learn] Using fit_intercept with sparse matrices

2016-07-05 Thread Gael Varoquaux
> > Jaidev is suggesting that fit_intercept=False makes no sense if the > > data is sparse. But I think that depends on your target variable. > It can make sense **not** to fit intercept e.g. if it has no impact on > perf it is faster to optimize without one +1 ___

Re: [scikit-learn] Using fit_intercept with sparse matrices

2016-07-05 Thread Alexandre Gramfort
> Jaidev is suggesting that fit_intercept=False makes no sense if the data is > sparse. But I think that depends on your target variable. It can make sense **not** to fit intercept e.g. if it has no impact on perf it is faster to optimize without one ___

Re: [scikit-learn] Using fit_intercept with sparse matrices

2016-07-04 Thread Michael Eickenberg
On Tuesday, July 5, 2016, Joel Nothman wrote: > Jaidev is suggesting that fit_intercept=False makes no sense if the data > is sparse. > +1 > But I think that depends on your target variable. > +1 > > > > On 4 July 2016 at 22:11, Alexandre Gramfort < > [email protected]

Re: [scikit-learn] Using fit_intercept with sparse matrices

2016-07-04 Thread Joel Nothman
Jaidev is suggesting that fit_intercept=False makes no sense if the data is sparse. But I think that depends on your target variable. On 4 July 2016 at 22:11, Alexandre Gramfort < [email protected]> wrote: > On Mon, Jul 4, 2016 at 12:13 PM, Jaidev Deshpande > wrote: > > My

Re: [scikit-learn] Using fit_intercept with sparse matrices

2016-07-04 Thread Alexandre Gramfort
On Mon, Jul 4, 2016 at 12:13 PM, Jaidev Deshpande wrote: > My point was, would it not be useful to raise a warning when the input is > sparse and the user does _not_ want to fit the intercept? I don't get it. Just fit_intercept=False should do it. why a warning??? A _

Re: [scikit-learn] Using fit_intercept with sparse matrices

2016-07-04 Thread Jaidev Deshpande
On Mon, 4 Jul 2016 at 15:33 Tom DLT wrote: > note2: > > The LogisticRegression and Ridge(solver='sag') code do fit the intercept > without breaking sparsity. > > For other solvers in Ridge, in the case of a sparse X input, the solver > will automatically be changed to 'sag' and raise a warning. >

Re: [scikit-learn] Using fit_intercept with sparse matrices

2016-07-04 Thread Tom DLT
note2: The LogisticRegression and Ridge(solver='sag') code do fit the intercept without breaking sparsity. For other solvers in Ridge, in the case of a sparse X input, the solver will automatically be changed to 'sag' and raise a warning. Tom 2016-07-04 7:24 GMT+02:00 Tom Dupré la Tour : > not

Re: [scikit-learn] Using fit_intercept with sparse matrices

2016-07-02 Thread Alexandre Gramfort
note: the Lasso and ElasticNet code do fit the intercept without breaking sparsity. Alex ___ scikit-learn mailing list [email protected] https://mail.python.org/mailman/listinfo/scikit-learn

[scikit-learn] Using fit_intercept with sparse matrices

2016-07-02 Thread Jaidev Deshpande
Hi, I usually encounter many cases when I've forgotten that my input to the `AnyEstimator.fit` method is a sparse matrix, and I've set `fit_intercept=False`. To avoid this, I could of course make a habit of not tampering with the default `fit_intercept=True`, but I think it would be better and mo