メインコンテンツへスキップ

関数 histogram

histogram(
    table: 'wandb.Table',
    value: 'str',
    title: 'str' = '',
    split_table: 'bool' = False
) → CustomChart
W&B Table からヒストグラムチャートを作成します。 引数:
  • table: ヒストグラム用のデータを含む W&B Table。
  • value: ビン軸 (x軸) のラベル。
  • title: ヒストグラムプロットのタイトル。
  • split_table: 表を W&B UI の別セクションとして分割するかどうか。True の場合、表は “Custom Chart Tables” という名前のセクションに表示されます。デフォルトは False です。
戻り値:
  • CustomChart: W&B にログできるカスタムチャートオブジェクト。チャートをログするには、これを wandb.log() に渡します。
例:
import math
import random
import wandb

# ランダムデータを生成する
data = [[i, random.random() + math.sin(i / 10)] for i in range(100)]

# W&B の表を作成する
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})