다음을 통해 공유


BayesianSamplingAlgorithm 클래스

Bayesian 샘플링 알고리즘.

상속
azure.ai.ml.entities._job.sweep.sampling_algorithm.SamplingAlgorithm
BayesianSamplingAlgorithm

생성자

BayesianSamplingAlgorithm()

예제

SweepJob에 대한 Bayesian 샘플링 알고리즘 할당


   from azure.ai.ml.entities import CommandJob
   from azure.ai.ml.sweep import BayesianSamplingAlgorithm, Objective, SweepJob, SweepJobLimits

   command_job = CommandJob(
       inputs=dict(kernel="linear", penalty=1.0),
       compute=cpu_cluster,
       environment=f"{job_env.name}:{job_env.version}",
       code="./scripts",
       command="python scripts/train.py --kernel $kernel --penalty $penalty",
       experiment_name="sklearn-iris-flowers",
   )

   sweep = SweepJob(
       sampling_algorithm=BayesianSamplingAlgorithm(),
       trial=command_job,
       search_space={"ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}])},
       inputs={"input1": {"file": "top_level.csv", "mode": "ro_mount"}},
       compute="top_level",
       limits=SweepJobLimits(trial_timeout=600),
       objective=Objective(goal="maximize", primary_metric="accuracy"),
   )