Scikit-learn:데이터 분석

Pywiki
Sam (토론 | 기여)님의 2022년 2월 14일 (월) 10:20 판 (새 문서: == 개요 == 데이터 분석과 관련한 기능. == 회귀선 그리기 == <syntaxhighlight lang="python"> from sklearn.linear_model import LinearRegression x = # x축 데이터 y...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)
둘러보기로 가기 검색하러 가기

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)  # 회귀선을 얻을 수 있다.