Skip to content

Instantly share code, notes, and snippets.

@atriptoparadise
Last active July 27, 2019 13:09
Show Gist options
  • Save atriptoparadise/1778285a349f1c83d33873d5ae767abc to your computer and use it in GitHub Desktop.
Save atriptoparadise/1778285a349f1c83d33873d5ae767abc to your computer and use it in GitHub Desktop.
Data Preparation
y = data.dropna().y
X = data.dropna().drop(['y'], axis=1)
# Reserve 30% of data for testing
X_train, X_test, y_train, y_test = timeseries_train_test_split(X, y, test_size=0.3)
X_train_scaled = scaler.fit_transform(X_train)
X_test_scaled = scaler.transform(X_test)
# Linear Regression
lr = LinearRegression()
lr.fit(X_train_scaled, y_train)
plotModelResults(lr, X_train_scaled, X_test_scaled, plot_intervals=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment