Machine Learning, Linear Regression, Data Science, Artificial Intelligence.
np.linalg.inv(x.T@x)@x.T@y Now our estimated model can be used for inference as follows: # Fitting the linear model betas = fit_estimator(x) beta0hat = betas[0] beta1hat = betas[1] # Function used for inference est_model = lambda x: beta0hat + beta1hat*x # Plotting the data plt.scatter(x,y) #