-
-
Save gt3/89d4dbf1af34317dcd183960ec21bb5e 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
scaler_features = StandardScaler().fit(build_df[build_df.columns.values[:-1]]) | |
scaled_features = scaler_features.transform(build_df[build_df.columns.values[:-1]]) | |
scaler_label = StandardScaler().fit(np.array(build_df[build_df.columns.values[-1]]).reshape(-1, 1)) | |
scaled_label = scaler_label.transform(np.array(build_df[build_df.columns.values[-1]]).reshape(-1, 1)) | |
### Split data using train proportion of 0.7 | |
train_size = int(scaled_features[:, :-1].shape[0] * 0.7) | |
X_train, y_train = scaled_features[:train_size, :-1], scaled_label[:train_size, :] | |
X_test, y_test = scaled_features[train_size:, :-1], scaled_label[train_size:, :] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment