[머신러닝] 회귀 모델 (Regression Models) 1
회귀 모델 (Regression Models) 모델별 성능 확인을 위한 함수 import matplotlib.pyplot as plt import seaborn as sns import numpy as np from sklearn.metrics import mean_squared_error from IPython.display import Image np.set_printoptions(suppress=True, precision=3) my_predictions = {} my_pred = None my_actual = None my_name = None colors = ['r', 'c', 'm', 'y', 'k', 'khaki', 'teal', 'orchid', 'sandybrown', 'greenyell..
2022. 4. 16.
[머신러닝] 경사하강법 (Gradient Descent) 2
샘플에 활용할 데이터 셋 만들기 from IPython.display import Image import numpy as np import matplotlib.pyplot as plt def make_linear(w=0.5, b=0.8, size=50, noise=1.0): # 노이즈 거의 없음 x = np.random.rand(size) y = w * x + b noise = np.random.uniform(-abs(noise), abs(noise), size=y.shape) yy = y + noise plt.figure(figsize=(10, 7)) plt.plot(x, y, color='r', label=f'y = {w}*x + {b}') plt.scatter(x, yy, label='data') ..
2022. 4. 16.