15,743,427 members
See more:
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.

R2 RESULT :

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

MAE RESULT :
mae = mean_absolute_error(Y_test, y_pred)
print(mae)
44086549.25

MSE AND RMSE RESULT :
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 ?
Posted
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 ;)

Solution 1

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.

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

Top Experts
Last 24hrsThis month
 Graeme_Grant 115 OriginalGriff 95 merano99 40 Dave Kreskowiak 15 Member 11696155 10
 OriginalGriff 1,723 Richard MacCutchan 1,328 merano99 609 Rick York 455 Dave Kreskowiak 311

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