관계에 대한 개념이 없기 때문에 (소의 형태가 ‘소’라는 레이블로 이어져야 하지만) 관심 대상이 아닌 상관관
계에 빠져들게 됩니다.
5.9
추정 표준 오차
선형 회귀의 전체 오차를 측정하는 한 가지 방법은 제곱 오차 합
sum
of
squared
error
(
SSE
)입니다.
앞서 각 잔차를 제곱하고 합산하는 방법을 배웠습니다. 만약
y
^
이 직선으로 예측한 값이고
y
가
데이터의 각 실젯값을 나타내는 경우,
SSE
는 다음과 같이 계산합니다.
2
ˆ
= ()SSEyy−
∑
하지만 제곱한 값은 이해하기 어렵기 때문에 제곱근을 사용해 원래 단위로 다시 조정할 수 있
습니다. 또한 이 값을 평균하면
추정 표준 오차
standard
error
of
the
estimate
(
S
e
)가 됩니다.
n
이 데이터
포인트 개수라 할 때 파이썬에서 추정 표준 오차
S
e
를 계산하는 방법은 [예제
5
-
19
]와 같습니다.
2
ˆ
()
2
e
yy
S
n
−
=
−
∑
예제
5-19
추정 표준 오차 계산하기
import
pandas
as
pd
from
math
import
sqrt
# 데이터를 로드합니다.
points
=
list(pd.read_csv('https://bit.ly/2KF29Bd',
delimiter=",").itertuples())
n
=
len(points)
# 모델 파라미터를
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.