-
Notifications
You must be signed in to change notification settings - Fork 0
/
Q_10.py
19 lines (14 loc) · 829 Bytes
/
Q_10.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
def Q_10(self, X_train_scaled, X_test_scaled, y_train, y_test):
# Task 10: Given the (X_train, y_train) pairs denoting input matrix and output vector respectively,
# Fit a linear regression model using the close-form solution you learned in class to obtain
# the coefficients, beta's, as a numpy array of m+1 values (Please recall class lecture).
# Then using the computed beta values, predict the test samples provided in the "X_test_scaled"
# argument, and let's call your prediction "y_pred".
# Compute Root Mean Squared Error (RMSE) of your prediction.
# Finally, return the beta vector, y_pred, RMSE as a tuple.
# PLEASE DO NOT USE ANY LIBRARY FUNCTION THAT DOES THE LINEAR REGRESSION.
beta = []
y_pred = []
RMSE = -1
## YOUR CODE HERE ###
return (beta, y_pred, RMSE)