Why do i get weird score after scaling data?

hi im working on house price prediction

i have 300.000000 < total_sqft <30000.00000, and other two features have values between 1 to 16 ie for bath and bhk feature rest feature are one hot encoding(for location)…so applying feature scaling on total_sqft (StandardScaler())but then i get same score on training data(before and after scaling) but cross val data give score like this -3.521060163109078e+22



i get same results when i do this
x_train_scaled = x_train.copy()
x_train_scaled[‘total_sqft’] = x_train_scaled[‘total_sqft’] / x_train.total_sqft.max()
x_train_scaled[‘bath’] = x_train_scaled[‘bath’] / x_train.bath.max()
x_train_scaled[‘bhk’] = x_train_scaled[‘bath’] / x_train.bhk.max()

can anyone explain? what im doing wrong what i misunderstood

Hello, @unnatiii, one thing that I spot is, you have not scaled your x_cv accordingly. You can imagine what happens if your trained model received some non-scaled feature values.

Raymond

1 Like