타깃 벡터가 없기 때문에 예측과 정답을 평가할 수 없지만 군집 자체의 특성을 평가할 수 있습
니다. 클러스터 내의 샘플 간의 거리는 가깝고(즉, 조밀한 클러스터) 클러스터 간 거리는 먼
것(즉, 잘 구분된 클러스터)이 좋은 클러스터라고 직관적으로 생각할 수 있습니다. 실루엣 계
수는 이 두 특성을 측정한 하나의 수치를 제공합니다.
i
번째 샘플의 실루엣 계수를 구하는 공
식은 다음과 같습니다.
s
ba
ab
i
ii
ii
max,
여기에서
s
i
는 샘플
i
의 실루엣 계수입니다.
a
i
는 샘플
i
와 같은 클래스 안에 있는 모든 다른 샘
플 사이의 평균 거리입니다.
b
i
는 샘플
i
와 가장 가까운 다른 클러스터 안에 있는 샘플 사이의
평균 거리입니다.
silhouette
_
score
함수의 반환값은 모든 샘플의 실루엣 계수를 평균한 값
입니다. 실루엣 계수의 범위는 -
1
과
1
사이입니다.
1
은 조밀하고 잘 구분되는 클러스터를 의
미합니다.
참고
•사이킷런 문서:
silhouette
_
score
(
http
://
bit
.
ly
/
2BEVQV5
)
11.10
사용자 정의 평가 지표 만들기
과제
자신만의 지표를 사용하여 모델을 평가하고 싶습니다.
해결
평가 방법을 함수로 만들고 사이킷런의
make
_
scorer
함수를 사용하여 스코어 함수 ...
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.