Skip to Content
밑바닥부터 시작하는 데이터 과학 데이터 분석을 위한 파이썬 프로그래밍과 수학·통계 기초
book

밑바닥부터 시작하는 데이터 과학 데이터 분석을 위한 파이썬 프로그래밍과 수학·통계 기초

by Joel Grus, Hangyeol Kim, Seongju Ha, Eunjung Park
May 2022
Beginner to intermediate
448 pages
13h 7m
Korean
Insight
Content preview from 밑바닥부터 시작하는 데이터 과학 데이터 분석을 위한 파이썬 프로그래밍과 수학·통계 기초
Data Science
240
󻱴󽴔󽴔󻰧󻕻󺅿󻳤󺕧󻀃
S
2
는 집합 자체가 크기도 하고 엔트로피가 높다.)
수학적으로 말하자면 데이터
S
q
1
, ...,
q
m
의 비율을 가지는 파티션
S
1
, ...,
S
m
로 나누는 경우에 엔트로피는 다음과 같이 가중합으로 계산할 수 있다.
H = q
1
H(S
1
) + ... + q
m
H(S
m
)
이것을 코드로 작성하면 다음과 같다.
def partition
_
entropy(subsets: List[List[Any]]) -> float:
"""
주어진
데이터의
파티션
안의
엔트로피를
반환
"""
total
_
count = sum(len(subset) for subset in subsets)
return sum(data
_
entropy(subset) * len(subset) / total
_
count
for subset in subsets)
이 접근법의 한 가지 문제는, 다양한 값을 가지는 변수를 사용해서 파티션을 나누는 경우
오버피팅이 되어 엔트로피가 낮아진다는 것이다. 예를 들어 보자. 기존 데이터를 이용해서
은행 고객 중 주택담보대출을 갚지 못할 고객을 예측하는 의사결정나무를 만들려고 한다.
데이터에 고객들의 주민등록번호가 담겨 있는 변수가 있는데, 이 변수로 파티션을 나누면
파티션당 고객이 한 명씩만 속하게 되어 엔트로피가 모두 0이 ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’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
QuotationMarkI 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
QuotationMarkI’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
QuotationMarkI'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.
Mark W.
Embedded Software Engineer

You might also like

처음 시작하는 파이썬: 파이썬 패키지를 활용한 모던 컴퓨팅 입문

처음 시작하는 파이썬: 파이썬 패키지를 활용한 모던 컴퓨팅 입문

최길우, 빌 루바노빅

Publisher Resources

ISBN: 9788966262571