Machine Learning

지니 계수 (Gini Coefficient)

판교데싸 2021. 6. 4. 09:54

지니 계수

* 어떤값의 분배 상태를 표현하기 위해 로렌츠 곡선을 이용하여 값의 분배 정도를 수치화 하는 방법

-> 보통 경제적 불평등을 계수화 한 것이라 표현

-> 머신러닝에서는 Decision Tree model의 성능 평가를 하는데 사용

Gini index =A/(A+B)

코드 구현의 예시

def gini(list_of_values):

sorted_list = sorted(list_of_values) height, area = 0, 0

for value in sorted_list:

height += value area += height - value / 2.

fair_area = height * len(list_of_values) / 2.

return (fair_area - area) / fair_area

반응형

'Machine Learning' 카테고리의 다른 글

XGBoost: A Scalable Tree Boosting System  (0) 2022.08.16
검증지표 개념 이해하기  (0) 2022.03.29
Cost sensitve model (cutoff 설정)  (0) 2021.04.01
빈발 패턴 탐색  (0) 2021.01.01
계층적 군집화  (0) 2020.12.28
반응형