Documentation Index
Fetch the complete documentation index at: https://wb-21fd5541-john-wbdocs-2044-rename-serverless-products.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
関数 bar
bar(
table: 'wandb.Table',
label: 'str',
value: 'str',
title: 'str' = '',
split_table: 'bool' = False
) → CustomChart
wandb.Table のデータから棒グラフを作成します。
引数:
table: 棒グラフ用のデータを含む表。
label: 各棒のラベルに使用する列名。
value: 各棒の値に使用する列名。
title: 棒グラフのタイトル。
split_table: 表を W&B UI の別セクションに分けて表示するかどうか。True の場合、表は “Custom Chart Tables” という名前のセクションに表示されます。デフォルトは False です。
戻り値:
CustomChart: W&B にログできるカスタムチャートのオブジェクト。チャートをログするには、これを wandb.log() に渡します。
例:
import random
import wandb
# 表用のランダムデータを生成する
data = [
["car", random.uniform(0, 1)],
["bus", random.uniform(0, 1)],
["road", random.uniform(0, 1)],
["person", random.uniform(0, 1)],
]
# データを使って表を作成する
table = wandb.Table(data=data, columns=["class", "accuracy"])
# W&B の run を初期化し、棒グラフをログする
with wandb.init(project="bar_chart") as run:
# 表から棒グラフを作成する
bar_plot = wandb.plot.bar(
table=table,
label="class",
value="accuracy",
title="Object Classification Accuracy",
)
# 棒グラフを W&B にログする
run.log({"bar_plot": bar_plot})