So I had a similar question ..... a month or two ago? I think, so I think
that's relevant ~~ here it is.
It's still sort of a surprise to me too .

On Thu, Jan 24, 2013 at 11:50 AM, Flavio Vinicius <flavio...@gmail.com>
 wrote:

> I think you can only guarantee that R2 is always positive when
> performing linear regression with no constraints. Is this you case, or
> are you using another model? For example, when using a regression
> forest you cannot guarantee positive R2.
>
> Better explanation here:
>
> http://stats.stackexchange.com/questions/12900/when-is-r-squared-negative
> --
> Flavio
>
>
> On Thu, Jan 24, 2013 at 11:28 AM, Bertrand Thirion
> <bertrand.thir...@inria.fr> wrote:
> > If you use a cross validation scheme, where you estimate the residuals
> > variance on left-out data and compare it to the variance of the model
> with
> > the intercept only, then R^2 can be negative. This approach is an
> > alternative to adjusted R^2 for model selection, and probably makes more
> > sense when the model is penalized (i.e. you're no longer doing maximum
> > likelihood).
> > May be there's a more proper statistical term for that ?
> > HTH
> >
> > Bertrand
> >
> > ________________________________
> >
> > De: "Ronnie Ghose" <ronnie.gh...@gmail.com>
> > À: scikit-learn-general@lists.sourceforge.net
> > Envoyé: Jeudi 24 Janvier 2013 12:57:27
> > Objet: Re: [Scikit-learn-general] (no subject)
> >
> >
> > is it adjusted R^2? The usual R^2 can never be negative afaik
> >
> > http://en.wikipedia.org/wiki/Coefficient_of_determination
> >
> >
> > On Wed, Jan 23, 2013 at 2:42 PM, Andreas Mueller <
> amuel...@ais.uni-bonn.de>
> > wrote:
> >>
> >> Am 23.01.2013 20:32, schrieb Ronnie Ghose:
> >> > How can _best_score in GridSearchCV be negative? R^2 can only be from
> >> > 0 to -1 ...?
> >> R^2 can also be negative afaik. It is somewhat unstable for small sample
> >> sizes.
> >>
>


On Fri, Feb 22, 2013 at 1:39 PM, Steven Greening <sggreen...@gmail.com>wrote:

> Hello all,
>
> I tried to used r2_score to calculate the coefficient of determination
> for a multiple regression problem and find that it is producing
> negative values. Specifically I'm using the r2_score function with the
> permutation_test_score function, and a large majority of the r2 values
> from the permutations are negative. The code I'm running is straight
> forward and looks like this:
>
> scoreR2, permutation_scoresR2, pvalueR2 = permutation_test_score(enet,
> X, y, r2_score, cv=kf, n_permutations=1000, n_jobs=-1)
>
> This is my first time running into a problem with scikit, and so it's
> my first time posting a problem. My apologies if this is not the
> preferred method.
>
> -Steve
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> _______________________________________________
> Scikit-learn-general mailing list
> Scikit-learn-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to