[AI와빅데이터경영입문]
선형 회귀.ipynb 0.03MB import seaborn as sb # 데이터로드 mpgData = sb.load_dataset(‘mpg’) mpgData = mpgData.dropna() indVarNames = (‘cylinders’,’displacement’,’horsepower’,’weight’,’acceleration’,’model_year’) x_total = mpgData(indVarNames) depVarName=”mpg” y_total = mpgData(depVarName) from sklearn.model_selection import train_test_split x_total_np = x_total.to_numpy() y_total_np = y_total.to_numpy() x_train, x_test, y_train, y_test = train_test_split(x_total_np, y_total_np, test_size = 0.30, random_state=10) # 모형학습 from sklearn import linear_model reg = linear_model.LinearRegression() … Read more