Can we do log transform to one variable and sqrt to another for LinearRegression? If yes then what to do during MSE? Should I exp or square the y_test and prediction?
boston['medv_log'] = np.log(boston.medv) boston['lstat_sqrt'] = np.sqrt(boston.lstat) x = boston.lstat_sqrt y = boston.medv_log
Advertisement
Answer
If you transform variables in training and test sets you don’t need to care about your evaluation metric. In case you transform your target variable (with the log
function for example) you need to transform your predictions (with the exp
function) to get a real value.