linearReg, logisticReg


linearReg, logisticReg

# 1차원 데이터로 Linear Regression 기능을 연습한다. # ------------------------------------------------ import numpy as np import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression # 샘플 데이터 1,000개를 생성한다 # y = ax + b + e def createData(a, b, n): resultX = [] resultY = [] for i in range(n): x = np.random.normal(0.0, 0.5) y = a * x + b + np.random.normal(0.0, 0.05) resultX.append(x) resultY.append(y) return np.array(resultX).reshape(-1,1), np.array(resultY).reshape(-1,1) # Train 데이터 세트와 T...



원문링크 : linearReg, logisticReg