

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# Debugger XGBoost レポートルールを使って SageMaker AI XGBoost 推定器を構築する
<a name="debugger-training-xgboost-report-estimator"></a>

[CreateXGBoostReport](debugger-built-in-rules.md#create-xgboost-report) ルールは、トレーニングジョブから次の出力テンソルを収集します。
+ `hyperparameters` - 最初のステップで保存します。
+ `metrics` - 5 ステップごとに損失と精度を保存します。
+ `feature_importance` - 5 ステップごとに保存します。
+ `predictions` - 5 ステップごとに保存します。
+ `labels` - 5 ステップごとに保存します。

出力テンソルはデフォルトの S3 バケットに保存されます。例えば、`s3://sagemaker-<region>-<12digit_account_id>/<base-job-name>/debug-output/`。

XGBoost トレーニングジョブのために SageMaker AI 推定器を構築する場合は、次のサンプルコードに示すように、ルールを指定します。

------
#### [ Using the SageMaker AI generic estimator ]

```
import boto3
import sagemaker
from sagemaker.estimator import Estimator
from sagemaker import image_uris
from sagemaker.debugger import Rule, rule_configs

rules=[
    Rule.sagemaker(rule_configs.create_xgboost_report())
]

region = boto3.Session().region_name
xgboost_container=sagemaker.image_uris.retrieve("xgboost", region, "1.2-1")

estimator=Estimator(
    role=sagemaker.get_execution_role()
    image_uri=xgboost_container,
    base_job_name="debugger-xgboost-report-demo",
    instance_count=1,
    instance_type="ml.m5.2xlarge",
    
    # Add the Debugger XGBoost report rule
    rules=rules
)

estimator.fit(wait=False)
```

------