score function in linear regression model

Fatemeh Heydari f96.heydari at gmail.com
Wed Oct 26 02:18:21 EDT 2022


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


More information about the Python-list mailing list