Skip to main content
edited tags
Link
Dave
  • 67.1k
  • 7
  • 105
  • 305
edited title
Link
Jeremy Miles
  • 19k
  • 6
  • 46
  • 82

R2 $R^2$ on out-sample data set

Tweeted twitter.com/StackStats/status/1555750727816970240
added 150 characters in body
Source Link
Maaz
  • 317
  • 1
  • 9

The conventional definition of $R^2$ is: $R^2 = 1-SSE/SST$, where SSE denotes sum of squared errors and SST is total sum of squares ($n\times variance$, n being number of sample points in train set).

However, I want to see the fitness of my model on out-of-sample set (test set) or both train and test sets combined. Is it fine to use the same definition of $R^2$ by taking SSE and SST appropriately over test set or (train+test) sets, respectively - i.e? Eg. I train my model on $SST$ remains$n$ sample points. I want to check its performance on ($n+p$) points ($p$ being some new sample points out of the train set as the model is trained). Can I use $R^2 = 1-(SSE$ on that set only(n+p) points$)/(SST$ on (n+p) points$)$?

The conventional definition of $R^2$ is: $R^2 = 1-SSE/SST$, where SSE denotes sum of squared errors and SST is total sum of squares ($n\times variance$, n being number of sample points in train set).

However, I want to see the fitness of my model on out-of-sample set (test set) or both train and test sets combined. Is it fine to use the same definition of $R^2$ by taking SSE appropriately over test set or (train+test) sets, respectively - i.e. my $SST$ remains on train set as the model is trained on that set only?

The conventional definition of $R^2$ is: $R^2 = 1-SSE/SST$, where SSE denotes sum of squared errors and SST is total sum of squares ($n\times variance$, n being number of sample points in train set).

However, I want to see the fitness of my model on out-of-sample set (test set) or both train and test sets combined. Is it fine to use the same definition of $R^2$ by taking SSE and SST appropriately over test set or (train+test) sets, respectively? Eg. I train my model on $n$ sample points. I want to check its performance on ($n+p$) points ($p$ being some new sample points out of the train set). Can I use $R^2 = 1-(SSE$ on (n+p) points$)/(SST$ on (n+p) points$)$?

Source Link
Maaz
  • 317
  • 1
  • 9
Loading