Skip to content

Instantly share code, notes, and snippets.

@piEsposito
Created March 30, 2020 18:56
Show Gist options
  • Save piEsposito/d24e919758ae12044230de513fd72dd4 to your computer and use it in GitHub Desktop.
Save piEsposito/d24e919758ae12044230de513fd72dd4 to your computer and use it in GitHub Desktop.
X, y = load_boston(return_X_y=True)
X = StandardScaler().fit_transform(X)
y = StandardScaler().fit_transform(np.expand_dims(y, -1))
X_train, X_test, y_train, y_test = train_test_split(X,
y,
test_size=.25,
random_state=42)
X_train, y_train = torch.tensor(X_train).float(), torch.tensor(y_train).float()
X_test, y_test = torch.tensor(X_test).float(), torch.tensor(y_test).float()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment