> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 각 범주별로 `(P(tag = 1) - P(tag = 0))(log(P(tag = 1)) - log(P(tag = 0)))` 값을 계산합니다.

# categoricalInformationValue

<div id="categoricalInformationValue">
  ## categoricalInformationValue
</div>

도입 버전: v20.1.0

이진 타깃 변수와 관련된 범주형 피처의 정보값(IV)을 계산합니다.

각 범주에 대해 함수는 다음 값을 계산합니다: `(P(tag = 1) - P(tag = 0)) × (log(P(tag = 1)) - log(P(tag = 0)))`

여기서:

* P(tag = 1)은 주어진 범주에서 타깃이 1일 확률입니다
* P(tag = 0)은 주어진 범주에서 타깃이 0일 확률입니다

정보값(Information Value)은 예측 모델링에서 범주형 피처와 이진 타깃 변수 사이의 관계 강도를 측정하는 데 사용되는 통계량입니다.
절댓값이 클수록 예측력이 더 높음을 의미합니다.

결과는 각 이산형(범주형) 피처 `[category1, category2, ...]`가 `tag` 값을 예측하는 학습 모델에 얼마나 기여하는지를 나타냅니다.

**구문**

```sql theme={null}
categoricalInformationValue(category1[, category2, ...,]tag)
```

**인수**

* `category1, category2, ...` — 분석할 하나 이상의 범주형 피처입니다. 각 범주는 이산 값을 포함해야 합니다. [`UInt8`](/ko/reference/data-types/int-uint)
* `tag` — 예측 대상 이진 변수입니다. 값은 0과 1이어야 합니다. [`UInt8`](/ko/reference/data-types/int-uint)

**반환 값**

범주의 각 고유한 조합에 대한 정보 값을 나타내는 Float64 값의 배열을 반환합니다. 각 값은 대상 변수에 대해 해당 범주 조합의 예측력을 나타냅니다. [`Array(Float64)`](/ko/reference/data-types/array)

**예시**

**연령대와 모바일 사용량을 분석하는 기본 사용법**

```sql title=Query theme={null}
-- metrica.hits 데이터셋(https://sql.clickhouse.com/ 에서 이용 가능)을 사용하여 연령-모바일 관계 분석
SELECT categoricalInformationValue(Age < 15, IsMobile)
FROM metrica.hits;
```

```response title=Response theme={null}
[0.0014814694805292418]
```

**여러 범주형 피처와 사용자 인구통계 정보**

```sql title=Query theme={null}
SELECT categoricalInformationValue(
    Sex,                 -- 0=남성, 1=여성
    toUInt8(Age < 25),   -- 0=25세 이상, 1=25세 미만
    toUInt8(IsMobile)    -- 0=데스크톱, 1=모바일
) AS iv_values
FROM metrica.hits
WHERE Sex IN (0, 1);
```

```response title=Response theme={null}
[0.00018965785460692887,0.004973668839403392]
```
