メインコンテンツへスキップ
GitHub ソース

function 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を作成する
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})