import math
import random
import wandb
# 시간에 따른 다양한 고도에서의 온도 변화 시뮬레이션
data = [
[i, random.uniform(-10, 20) - 0.005 * i + 5 * math.sin(i / 50)]
for i in range(300)
]
# 고도(m)와 온도(°C) 컬럼을 가진 W&B Table 생성
table = wandb.Table(data=data, columns=["altitude (m)", "temperature (°C)"])
# W&B run을 초기화하고 산점도를 로그에 기록
with wandb.init(project="temperature-altitude-scatter") as run:
# 산점도 생성 및 로그 기록
scatter_plot = wandb.plot.scatter(
table=table,
x="altitude (m)",
y="temperature (°C)",
title="Altitude vs Temperature",
)
run.log({"altitude-temperature-scatter": scatter_plot})