[AI]/python.sklearn

sklearn.비용함수.경사 하강법(stochastic gradient descent)

givemebro 2020. 4. 7. 15:36
반응형

stochastic gradient descent

rng=np.arange(mm-2,mm+2,0.1)
plt.plot(rng,((data-rng.reshape(-1,1))**2).mean(axis=1))
plt.vlines([mm],11,15,linestyles=':')
plt.ylabel=('MSE')
plt.xlabel=('prediction')

# 평균일 때, 오차가 가장 작고

# 평균과 멀어지면 오차는 증가한다.

반응형