"Scikit-learn:데이터 분석"의 두 판 사이의 차이
둘러보기로 가기
검색하러 가기
(새 문서: == 개요 == 데이터 분석과 관련한 기능. == 회귀선 그리기 == <syntaxhighlight lang="python"> from sklearn.linear_model import LinearRegression x = # x축 데이터 y...) |
(차이 없음)
|
2022년 2월 14일 (월) 10:20 판
1 개요
데이터 분석과 관련한 기능.
2 회귀선 그리기
from sklearn.linear_model import LinearRegression
x = # x축 데이터
y = # y축 데데이터
model = LinearRegression()
model.fit(x, y)
y_pred = pd.Series(model.predict(x), index=x.index) # 회귀선을 얻을 수 있다.