Questions tagged [r-squared]

For questions regarding R-squared ($R^2$), a statistical measure that represents the proportion of the variance for a dependent variable that's explained by an independent variable or variables in a regression model.

R-Squared ($R^2$ or the coefficient of determination) is a statistical measure in a regression model that determines the proportion of variance in the dependent variable that can be explained by the independent variable. In other words, r-squared shows how well the data fit the regression model (the goodness of fit).

The formula for calculating R-squared is:

$R-Squared(R^2) = \frac{SS_{regression}}{SS_{total}}$

Where:

  • $SS_{regression}$ is the sum of squares due to regression (explained sum of squares)
  • $SS_{total}$ is the total sum of squares
15 questions
3
votes
3 answers

Is R2 score a reasonable regression measure on huge datasets?

I'm running a regression model on a pretty large data set and getting a fairly woeful $R^2$ score of ~0.2 (see plot below), despite the plot looking like the model is generally pointing in the right direction. My question is, when you have over a…
jshep
  • 393
  • 1
  • 6
2
votes
1 answer

Why would the result change so much for a linear regression with or without a constant?

I was running a Linear Regression with Wooldridge dataset named GPA2, which is found on Python library named wooldridge. I tried two linear regressions. The first: results = smf.ols('colgpa ~ hsperc + sat', data=gpa).fit() And the second results =…
dsbr__0
  • 191
  • 1
  • 3
2
votes
0 answers

Multi-dimensional Euclidian R^2 squared - reasonable?

I have a high-dimensional space, say $\mathbb{R}^{1000}$, and I have samples $y_1, \ldots , y_n \in \mathbb{R}^{1000}$ and $\hat{y}_1, \ldots , \hat{y}_n \in \mathbb{R}^{1000}$. Would $$ R^2 = 1 - \frac{\sum_i || y_i - \hat{y}_i||^2}{\sum_i || y_i -…
2
votes
2 answers

SKlearn PolynomialFeatures R^2 score

I'm trying to create a linear regression model with use of PolynomialFeatures. But when I evaluate it, I get really strange scores. I know that R^2 can be applied to this model and I think I've trying everything. I'd really apricate a good advice.…
kosekk_g
  • 23
  • 4
1
vote
1 answer

Does statsmodels compute R2 and other metrics on a validation-/test- set?

Does statsmodels compute R2 and other metrics on a validation set? I am using the OLS from the statsmodels.api when printing summary, an r2 and r2_asjusted are presented. I did not trust those 0.88 and computed an own adjusted R2 with scikit-learn…
1
vote
1 answer

Calculate RMSE based on R squared and vice versa

If for example I have the value of RMSE can I calculate the $R^2$? And vice versa if I have the value of $R^2$ can I calculate the value of RMSE? I have all predictions, dataset, training set, and test set.
1
vote
1 answer

Why does an unimportant feature has a big impact on R2 in XGBoost?

I am training an XGBoost model, xgbr, using xgb.XGBRegressor() with 13 features and one numeric target. The R2 on the test set is 0.935, which is good. I am checking the feature importance by for col,score in…
volkan g
  • 21
  • 1
1
vote
0 answers

Does the appliance of R-squared to non-linear models depends on how we calculate it?

Does the appliance of R-squared to non-linear models depends on how we calculate it? $R^2 = \frac{SS_{exp}}{SS_{tot}}$ is going to be an inadequate measure for non-linear models since an increase of $SS_{exp}$ doesn't necessarily mean that the…
1
vote
3 answers

Determining which model result is better

I am trying to determine which model result is better. Both results are trying to achieve the same objective, the only difference is the exact data that is being used. I used random forest, xgboost, and elastic net for regression. Here is one of the…
justanewb
  • 83
  • 5
0
votes
2 answers

Can someone explain the solution to the following problem?

Q) We want to learn a function f(x) of the form f(x) = ax + b which is parameterized by (a, b). Using squared error as the loss function, which of the following parameters would you use to model this function to get a solution with the minimum…
0
votes
0 answers

How to improve the $R^2$ score on an autoencoder model when the loss(KLDivergence) and validation MAE is giving desired scores?

I have been training an autoencoder for data with 25k feats and 1k data points. The $R^2$ score is coming negative on every epoch, and around -27 on both train and test sets, although the MAE is 0.7 on both the train and test sets.
0
votes
0 answers

How is R squared calculated in context to H.clustering?

I was reading the paper "Consistent Individualized Feature Attribution for Tree Ensembles" by Scott Lundberg et al. and cannot understand how the calculation for the $R^2$ works here - see explanation on the image. From this paper, the authors…
Penguines
  • 11
  • 1
0
votes
0 answers

Is r-squared a good metric for nonlinear models?

I come to ask if the r-squared metric is correct for assessing the quality of nonlinear models? I found very interesting thread on reddit Is r-squared useless with proofs from a statistics professor, but I am not sure if similar I can transfer…
opi
  • 1
0
votes
1 answer

Can both R-square and Adjusted R-square be same?

I am solving a Multiple Linear Regression problem and judging the model by looking at R-square and Adjusted R-square metrics. In recent iteration which are yielding desired coefficients directionally with respect to Target, I am getting both…
0
votes
1 answer

Do I need to rescale input labels before training (label values between 20..51)?

I'm trying to build model for this datatset (Age prediction): The input image has the shape: 3, 128, 128 and the predicted labels (ages) range between 20 to 51. I want to build model and train it with MSE and R2 metrics. I built the following…
user3668129
  • 363
  • 2
  • 11