I found that there has been extensive discussion on the invalidity of R-squared for nonlinear models according to its original definition based on the following mathematical analysis,.
The variance in the dependent variable: $$\sum{((Y_i-\bar{Y}))^2} = \sum{((Y_i-\hat{Y_i})+(\hat{Y_i}-\bar{Y}))^2} \\= \sum{(Y_i-\hat{Y_i})^2} + \sum{(\hat{Y_i}-\bar{Y})^2} + 2*\sum{(Y_i-\hat{Y_i})*(\hat{Y_i}-\bar{Y})}$$
In nonlinear models, it is generally not true that the third term, $\sum{(Y_i-\hat{Y_i})(\hat{Y_i}-\bar{Y})}=0$, which is necessary for R-squared to be strictly applicable.
However, in cases where linear models are regularized or the parameters of the linear model are subjectively chosen, $\sum{(Y_i-\hat{Y_i})(\hat{Y_i}-\bar{Y})}$ may not equal zero as well. So, my question is whether R-squared is valid for these linear models?
Hawinkel, Stijn, Willem Waegeman, and Steven Maere. "Out-of-sample R 2: estimation and inference." The American Statistician just-accepted (2023): 1-16.
– Alex Oct 01 '23 at 09:36