-
-
Save BinarySpoon/b76b341a1a5ed31221928ad489d61b6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Log transformation --> | |
features = ['NOX','PTRATIO','RM','TAX','LSTAT','INDUS'] | |
x_data = boston_data.loc[:,features] | |
y_label = boston_data['Target'] | |
min_max_scaler = MinMaxScaler() | |
x_data = pd.DataFrame(data=min_max_scaler.fit_transform(x_data), columns = features) | |
y_label = np.log1p(y_label) | |
for features in x_data.columns: | |
if np.abs(x_data[features].skew()) > 0.5: | |
x_data[features] = np.log1p(x_data[features]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment