I am training a Decision tree regressor on the famous Boston House Price dataset. I read that tree based models are fairly immune to scaling so I tried to see practically. Before scaling I was getting MAE = 2.61. After scaling using StandardScaler, I got worse results which is quite surprising as scaling the data should result in an improvement. Also if not an improvement, I was hoping to see the same result as I got without scaling since I am using a tree based model. Also there are no categorical variables in this dataset and all the variables included in the scale_list a large difference in their min and max values hence have been included. I have not included and binary (1's and 0's)variables.
train_x, test_x, train_y, test_y = train_test_split(data2, y, test_size = 0.2, random_state = 69) #STANDARDIZING THE DATA scale_list = ['CRIM', 'NOX', 'RM', 'AGE', 'DIS', 'TAX', 'PTRATIO', 'B', 'LSTAT'] train_x_stand = train_x.copy() test_x_stand = test_x.copy() for i in scale_list: scale = StandardScaler().fit(train_x_stand[[i]]) train_x_stand[i] = scale.transform(train_x_stand[[i]]) test_x_stand[i] = scale.transform(test_x_stand[[i]])
Any help would be appreciated!