

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

# Buat XGBoost estimator SageMaker AI dengan aturan Laporan XGBoost Debugger
<a name="debugger-training-xgboost-report-estimator"></a>

[CreateXgboostReport](debugger-built-in-rules.md#create-xgboost-report)Aturan mengumpulkan tensor keluaran berikut dari pekerjaan pelatihan Anda: 
+ `hyperparameters`— Menyimpan pada langkah pertama.
+ `metrics`— Menghemat kerugian dan akurasi setiap 5 langkah.
+ `feature_importance`— Menyimpan setiap 5 langkah.
+ `predictions`— Menyimpan setiap 5 langkah.
+ `labels`— Menyimpan setiap 5 langkah.

Tensor keluaran disimpan di bucket S3 default. Misalnya, `s3://sagemaker-<region>-<12digit_account_id>/<base-job-name>/debug-output/`.

Saat Anda membuat estimator SageMaker AI untuk pekerjaan XGBoost pelatihan, tentukan aturan seperti yang ditunjukkan pada kode contoh berikut.

------
#### [ 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)
```

------