Last active
October 24, 2020 05:56
-
-
Save finlytics-hub/61aa4c9e867802dd1b5cfc52c9822a06 to your computer and use it in GitHub Desktop.
Linear Regression - Normal Equation - Prediction
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
# make predictions on new data - deliberately chosen the minimum and maximum possible X values to plot a straight line | |
X_new = np.array([[0], [5]]) | |
# add ones | |
X_new_2d = np.c_[np.ones((2, 1)), X_new] | |
# predict | |
y_predict = X_new_2d.dot(theta_best) | |
y_predict |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment