Scikit Learn

회귀분석 응용RM ~ LSTAT 두 변수를 이용한 다중회귀분석 # Price ~ RM + LSTAT + RM**2 + RM * LSTAT + LSTAT**2# Price = b0 + b1 * rm + b2 * lstat + b3 * rm**2 + b4 * rm * lstat + b5 * lstat **2# 학습 세트에 다항식항(컬럼)을 추가X_train_rm_lstat_poly = poly.fit_transform(X_train_rm_lstat)# 테스트 세트에 다항식항(컬럼)을 추가X_test_rm_lstat_poly = poly.fit_transform(X_test_rm_lstat)print(X_test_rm_lstat_poly[:2])lin_reg.fit(X_train_rm_lstat_poly, y..
y = b + a * x: linear regressiony = b + a1 * x + a2 * x^2 -> 선형 회귀로 b, a1, a2를 결정할 수 있다. y = b + a1 * x1 + a2 * x2: 선형 회귀y = b + a1 * x1 + a2 * x2 + a3 * x1^2 + a4 * x1 * x2 + a5 * x2^2 import numpy as npimport matplotlib.pyplot as plt # Training Set - data : 범위 -3
사이킷런의 linear_regression 사용하기 위한 패키지 importimport numpy as npimport matplotlib.pyplot as pltfrom sklearn import linear_modelfrom sklearn.datasets import load_diabetes 비만 데이터 LoadX, y = load_diabetes(return_X_y=True)print(X[:5])print(X.shape, y.shape) [[ 0.03807591 0.05068012 0.06169621 0.02187235 -0.0442235 -0.03482076 -0.04340085 -0.00259226 0.01990842 -0.01764613][-0.00188202 -0.04464164 -0.051..
Codezoy
'Scikit Learn' 태그의 글 목록