> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# roc_curve()

export const GitHubLink = ({url, compact = false}) => <a href={url} target="_blank" rel="noopener noreferrer" className={compact ? "source-link" : "github-source-link"}>
    {compact ? "View source" : <>
    <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
      <path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" />
    </svg>
    GitHub source
      </>}
  </a>;

<GitHubLink compact url="https://github.com/wandb/wandb/blob/main/wandb/plot/roc_curve.py#L16" />

<h2 id="function-wandbplotroc_curve">
  <Badge color="blue" size="lg" shape="rounded">함수</Badge> wandb.plot.roc\_curve()
</h2>

수신자 조작 특성(ROC) 곡선 차트를 구성합니다.

```python theme={"system"}
y_true: 'Sequence[numbers.Number]',
y_probas: 'Sequence[Sequence[float]] | None' = None,
labels: 'list[str] | None' = None,
classes_to_plot: 'list[numbers.Number] | None' = None,
title: 'str' = 'ROC Curve',
split_table: 'bool' = False
```

<h2 id="args">
  인수
</h2>

<ResponseField name="y_true" type="Sequence[numbers.Number]">
  타깃 변수의 실제 클래스 레이블(ground truth)입니다. 형태는 (num\_samples,)이어야 합니다.
</ResponseField>

<ResponseField name="y_probas" type="Sequence[Sequence[float]] | None">
  각 클래스에 대한 예측 확률 또는 결정 점수입니다. 형태는 (num\_samples, num\_classes)이어야 합니다.
</ResponseField>

<ResponseField name="labels" type="list[str] | None">
  `y_true`의 클래스 인덱스에 해당하는 사람이 읽을 수 있는 레이블입니다. 예를 들어 `labels=['dog', 'cat']`인 경우 클래스 0은 플롯에서 'dog'으로, 클래스 1은 'cat'으로 표시됩니다. None이면 `y_true`의 원시 클래스 인덱스가 사용됩니다. 기본값은 None입니다.
</ResponseField>

<ResponseField name="classes_to_plot" type="list[numbers.Number] | None">
  ROC 곡선에 포함할 고유 클래스 레이블의 하위 집합입니다. None이면 `y_true`의 모든 클래스가 플롯됩니다. 기본값은 None입니다.
</ResponseField>

<ResponseField name="title" type="str">
  ROC 곡선 플롯의 제목입니다. 기본값은 "ROC Curve"입니다.
</ResponseField>

<ResponseField name="split_table" type="bool">
  table을 W\&B UI의 별도 section으로 분할할지 여부입니다. `True`이면 table이 "Custom Chart Tables"라는 section에 표시됩니다. 기본값은 `False`입니다.
</ResponseField>

<h2 id="returns">
  반환값
</h2>

`CustomChart`: W\&B에 로깅할 수 있는 맞춤형 차트 객체입니다. 차트를 로깅하려면 `wandb.log()`에 전달하세요.

<h2 id="raises">
  예외
</h2>

* `wandb.Error`: numpy, pandas 또는 scikit-learn을 찾을 수 없는 경우.

<h2 id="examples">
  예시
</h2>

```python theme={"system"}
import numpy as np
import wandb

# 세 가지 질병을 대상으로 의료 진단 분류 문제를 시뮬레이션합니다
n_samples = 200
n_classes = 3

# 정답 레이블: 각 샘플에 "당뇨병", "고혈압", "심장병" 중 하나를
# 부여합니다
disease_labels = ["Diabetes", "Hypertension", "Heart Disease"]
# 0: 당뇨병, 1: 고혈압, 2: 심장병
y_true = np.random.choice([0, 1, 2], size=n_samples)

# 예측 확률: 각 샘플의 확률 합이 1이 되도록
# 예측을 시뮬레이션합니다
y_probas = np.random.dirichlet(np.ones(n_classes), size=n_samples)

# 그래프로 표시할 클래스를 지정합니다(세 가지 질병 모두 표시)
classes_to_plot = [0, 1, 2]

# W&B run을 초기화하고 질병 분류용 ROC 곡선 플롯을 로깅합니다
with wandb.init(project="medical_diagnosis") as run:
    roc_plot = wandb.plot.roc_curve(
        y_true=y_true,
        y_probas=y_probas,
        labels=disease_labels,
        classes_to_plot=classes_to_plot,
        title="ROC Curve for Disease Classification",
    )
    run.log({"roc-curve": roc_plot})
```


## Related topics

- [Custom Charts 개요](/ko/products/wandb/ref/python/custom-charts.md)
