7
$\begingroup$

I am using non-negative lasso(sklearn) on a dataset with 1.5MM data points and 120 features. It is a low R2 environment (working with noisy financial data), so $R^2$ is about 10%. What I am more worried though, is that the standard deviation of the predictions is about $\frac{1}{4}$ of the standard deviation of the target variable. Similarly, mean(abs(target)) / mean(abs(predicted)) is about $\frac{1}{4}$.

How can I get that ratio to be closer to 1? I am willing to sacrifice some $R^2$ to achieve this. Do I need to do different type of regression, transform my features in some way, or is there anything else that can be done? In other words, the predictions are too smooth for my application.

If possible, I would like a suggestion how to get results (predictions) that are similar size to target, while still having similar (now much lower) $R^2$.

Maybe I should use different objective function rather than min. sum of squares?

$\endgroup$
7
  • 3
    $\begingroup$ Possible duplicate of Regression predictions show far less variance than expected $\endgroup$ Commented Feb 7, 2019 at 15:13
  • $\begingroup$ I get the sense (from low reputation) that this is a relatively new user. There is a decent chance that they aren't expert at finding previous questions like theirs. This could easily, and probably is, and we should presume it probably is, a genuine question from a novel asker. If that is the case, we should do some hand-holding, point out options, or ask for clarification in areas that might help show the difference between the two questions. $\endgroup$ Commented Feb 7, 2019 at 16:05
  • 1
    $\begingroup$ Thanks, but I believe I've sufficiently elaborated on my question. It says specifically what I am interested in, and the other question does not have any input that addresses my concerns. $\endgroup$
    – RedBaron
    Commented Feb 7, 2019 at 16:15
  • 1
    $\begingroup$ @RedBaron, I tried to give an answer to your question, but the linked answer indeed explains the underlying issue also affecting your issue, even if the estimator applied is different. $\endgroup$ Commented Feb 8, 2019 at 10:39
  • 2
    $\begingroup$ @gung - I agree. Duplicates are totally cool. Just saying that goes a long way. "It looks like you are new. Yours looks like this one -insert link here-". That is hand-holding. I saw several close votes and only one comment, and that means that folks were doing nearly the opposite of that. $\endgroup$ Commented Feb 8, 2019 at 17:25

1 Answer 1

9
$\begingroup$

My answer will focus on the baseline OLS case, but the mechanics are similar for techniques like Lasso (although I'll admit that I do not know how $R^2$ is computed for such methods). Also, my answer relates to in-sample fit.

Recall that $R^2$ is defined as (also recall that the mean of the fitted values equals the mean of the $y$, $\bar y=\bar{\hat{y}}$) $$ R^2=\frac{(\hat y-\bar y)'(\hat y-\bar y)}{(y-\bar y)'(y-\bar y)}, $$ which we may rewrite into the ratio of variance explained to variance of the dependent variable, $$ R^2=\frac{\frac{1}{n-1}\sum_i(\hat y_i-\bar y)^2}{\frac{1}{n-1}\sum_i( y_i-\bar y)^2}=\frac{\hat\sigma^2_{\hat y}}{\hat\sigma^2_{y}}, $$ So, when you have a low $R^2$, that is tantamount to saying that the standard deviation of the predictions is less than the standard deviation of the target variable. A fortiori, if you "sacrifice" $R^2$, that ratio can only decrease further.

Here is a little graphical illustration, in which both the $y_i$ (blue) and the fitted values (salmon) are projected onto the y-axis, for a dataset in which $R^2$ is relatively low. We observe that the variation of the fitted values is, as expected, smaller.

enter image description here

$\endgroup$
2
  • $\begingroup$ @hanck Your explanation is clear but I very much need a citation for "when you have a low 𝑅2, that is tantamount to saying that the standard deviation of the predictions is less than the standard deviation of the target variable." I have looked for MANY hours. I am surprised to find only one paper, which applies rather than justifies the concept (Farmer 2016 doi:10.1002/2016WR019129). Any suggestions pls? Does the concept have a name on which I might search? Ideally the paper(s) would also discuss implications. $\endgroup$
    – InColorado
    Commented Feb 5, 2021 at 5:48
  • $\begingroup$ I am sorry but I do not have a citation of this point. It is an immediate consequence of the fact that $R^2=\frac{\hat\sigma^2_{\hat y}}{\hat\sigma^2_{y}}$, so low $R^2$ means low $\frac{\hat\sigma^2_{\hat y}}{\hat\sigma^2_{y}}$ or, equivalently, low $\frac{\hat\sigma_{\hat y}}{\hat\sigma_{y}}$. $\endgroup$ Commented Feb 5, 2021 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.