Yapay sinir aglari ile satis tahmini problemi cozdugumde R2 degerinin negatif cikmasi ne ifade ediyor. R2 degeri hangi aralikta olmalidir?
1 回表示 (過去 30 日間)
古いコメントを表示
5 件のコメント
John D'Errico
2022 年 12 月 17 日
Walter is correct. A negative R^2 is a typical symptom of a model that lacks a constant term, but in fact, it could really use a constant term. Essentially it tells you that your model predicts more poorly than just using a constant predictor for your model.
the cyclist
2022 年 12 月 17 日
A minor correction for posterity:
It's not that negative R^2 indicates that the model is worse than random in predicting the data. It's worse than using the mean response as the prediction for all observations. This is the "horizontal line" mentioned in the documentation that @Walter Roberson quoted.
The reason the mean is relevant is that it is the baseline from which the "total sum of squares" of the data is calculated, which in turn enters into the calculation of R^2.
回答 (1 件)
John D'Errico
2023 年 1 月 19 日
Let me give an example.
x = rand(100,1);
y = 5 - 3*x + randn(size(x));
plot(x,y,'o')
First, fit a LINEAR polynomial model to the data.
[mdl,gof] = fit(x,y,'poly1')
So this model has an r^2 value of 0.4319. Compare that to a model that completely lacks a constant term.
ft = fittype('a*x','indep','x');
[mdlnocon,gofnocon] = fit(x,y,ft)
Here the R^2 is a strange looking -2.8. And yes, R^2 is always supposed to be between 0 and 1. But what you need to understand is that ONLY applies when you have a constant term in your model. Otherwise, R^2 is complete gibberish for a model with no constant term.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Regression についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!