Query related Linear Regression

Below i am providing the github link where i am working on linear regression model on Salary Dataset, where i am prediciting the salary based on age and experience.
Can someone please let me know my mistake and can help me to improve accuracy of all the models.

Had the predesposition of looking into your code and it seems you get pretty good accuracy with scaler=MinMaxScaler(), with linear regression, right? One advice I could give you should use more data for training not 50/50 split maybe something 80/20 split, you dont have a lot of examples anyway!

1 Like

thanks for the advice it has helped me increasing the accuracy of the model, but now its value is in negative.so what should i do for that?

MAE - 0.0323585473969535
MSE - 0.01007503325524715
R2 Score - -0.9100450267384512

Are you referring to R2 score, maybe a linear regression is not the best model for this problem and also you need more data to train on.

yes i was referring to r2 score, and now i have splitted the data in 80:20 ratio,which other model will be best for this problem

I am not sure you have to try out which model can perform better maybe a polynomial linear regression, maybe a neural network, maybe xgboost…you have to try out several options that can fit best your distribution of data.

1 Like