model.score(X,Y)
On Sun, Oct 23, 2022 at 05:11:10AM -0700, Fatemeh Heydari wrote:
model.score(X,Y)
That will basically check how good your model is.
It takes a bunch of X values with known values, which you provide in Y
and compares the output of model.Predict(X) with the Y's and gives you
some metrics as to how good that performed.
In the case of linear regression that be R^2, the coefficient of determination
of the prediction.
Cheers,
Reto
On Monday, October 24, 2022 at 7:14:10 AM UTC-7, Reto wrote:
On Sun, Oct 23, 2022 at 05:11:10AM -0700, Fatemeh Heydari wrote:
model.score(X,Y)
That will basically check how good your model is.
It takes a bunch of X values with known values, which you provide in Y
and compares the output of model.Predict(X) with the Y's and gives you
some metrics as to how good that performed.
In the case of linear regression that be R^2, the coefficient of determination
of the prediction.
Cheers,
Reto
Dear Reto
Thanks for your attention. But I calculated R^2 for the model with the code : r2_score(predictedY,Y)
and I got different result from the "score " function. I wish to know what mathematical formulation is behind this function
Thanks again
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 741 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 109:14:56 |
| Calls: | 12,461 |
| Calls today: | 3 |
| Files: | 15,197 |
| Messages: | 6,538,107 |