hjkkkl / machine-learning

0 stars 0 forks source link

113 #2

Open hjkkkl opened 7 hours ago

hjkkkl commented 7 hours ago

theta = np.linalg.inv(X.T.dot(x))dot(X.T).dot(y) theta

정규 방정식을 푸는 것 = 선형 대수 서브 모듈 linalg를 이용하면됨 -> 최적 파라미터 계산가능

--

def h(x, theta): return X*theta[1] + theta[0]

데이터와 가설을 비교

lin_data.plot(kind = 'scatter', x ='input', y = 'pollution') # 데이터 plt.plot([0, 1], [h(0, theta), h(1, theta)]) # 가설