Click here to Skip to main content
15,743,427 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
In here i try to predict selling price of used car using XGBoost algorithm, the total of dataset is only 311. for the column are Name, seller type, year, selling price, transmission, km driven, owner.


score = metrics.r2_score(Y_test, y_pred)
print("Training score: ", score)
Training score: 0.5955576270160517

mae = mean_absolute_error(Y_test, y_pred)

ypred = xg.predict(X_test)
mse = mean_squared_error(Y_test, ypred)
print("MSE: %.2f" % mse)

print("RMSE: %.2f" % (mse**(1/2.0)))

MSE: 3642018972287394.00
RMSE: 60349142.27

What I have tried:

Anyone can explain about the score, is the score perfect or not ?
0x01AA 9-Apr-23 8:43am    
What I understand when reading the documentation is: A score of 1 is perfect. Therefor 0.6 is something away from being perfect ;)

1 solution

The perfect R2 score is 1. Yours is 0.6, which feels high to me given the context of predicting used car prices.

Your MAE result looks totally off though. It suggests your that your predicted price is off by 44 million. I don't know which units you're using, but even if it's in say, the Korean Won, that suggests your predictions are off by more then $40,000 USD per car.

Your MSE (and therefore also your RMSE) look totally off as well, for the same reason that your MAE is off.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900