View a markdown version of this page

Buat estimator SageMaker AI XGBoost dengan aturan Debugger XGBoost Report - Amazon SageMaker AI

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

Buat estimator SageMaker AI XGBoost dengan aturan Debugger XGBoost Report

CreateXgboostReportAturan 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 pelatihan XGBoost, tentukan aturan seperti yang ditunjukkan dalam 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)