[머신러닝] Linear Regression
import numpy as np import pandas as pd import matplotlib.pylab as plt dfLoad=pd.read_csv('https://sites.google.com/site/vlsicir/testData_LinearRegression.txt', sep="\s+"); xxRaw=dfLoad["xx"] yyRaw=dfLoad["yy"] plt.plot(xxRaw, yyRaw, "r. ") N=len(xxRaw) X=np.c_[np.ones([N, 1]), xxRaw] y=np.array(yyRaw).reshape(N, 1) wOLS=np.linalg.inv(X.T.dot(X)).dot(X.T).dot(y) xSample=np.arange(0, 2, 0.01) xSam..
2020.07.12