update week35

This commit is contained in:
Morten Hjorth-Jensen
2021-09-14 22:57:56 +02:00
parent 1f9e4412cb
commit 697aa73253
9 changed files with 153 additions and 208 deletions
-4
View File
@@ -2571,10 +2571,6 @@ X[:,1] = x
X[:,2] = x*x
# We split the data in test and training data
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
scaler = StandardScaler()
scaler.fit(X_train)
X_train_scaled = scaler.transform(X_train)
X_test_scaled = scaler.transform(X_test)
# matrix inversion to find beta
OLSbeta = np.linalg.inv(X_train.T @ X_train) @ X_train.T @ y_train