메인 콘텐츠로 건너뛰기
GitHub 소스

function histogram

histogram(
    table: 'wandb.Table',
    value: 'str',
    title: 'str' = '',
    split_table: 'bool' = False
) → CustomChart
W&B Table로부터 히스토그램 차트를 생성합니다. Args:
  • table: 히스토그램에 사용할 데이터를 포함한 W&B Table.
  • value: 구간 축(가로축, x-axis)의 레이블.
  • title: 히스토그램 플롯의 제목.
  • split_table: 이 테이블을 W&B UI에서 별도의 섹션으로 분리할지 여부. True이면 테이블은 “Custom Chart Tables”라는 섹션에 표시됩니다. 기본값은 False입니다.
Returns:
  • CustomChart: W&B에 로깅할 수 있는 커스텀 차트 객체. 차트를 로깅하려면 이 객체를 wandb.log()에 전달합니다.
Example:
import math
import random
import wandb

# 랜덤 데이터 생성
data = [[i, random.random() + math.sin(i / 10)] for i in range(100)]

# W&B Table 생성
table = wandb.Table(
    data=data,
    columns=["step", "height"],
)

# 히스토그램 플롯 생성
histogram = wandb.plot.histogram(
    table,
    value="height",
    title="My Histogram",
)

# W&B에 히스토그램 플롯 로깅
with wandb.init(...) as run:
    run.log({"histogram-plot1": histogram})