

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 모델 품질
<a name="model-monitor-model-quality"></a>

모델 품질 모니터링 작업은 모델의 예측과 모델이 예측하려는 실제 Ground Truth 레이블을 비교하여 모델의 성능을 모니터링합니다. 이를 위해 모델 품질 모니터링은 실시간 또는 배치 추론에서 캡처한 데이터를 Amazon S3 버킷에 저장한 실제 레이블과 병합한 다음 예측을 실제 레이블과 비교합니다.

모델 모니터는 모델의 품질을 측정하기 위해 ML의 문제 유형에 따라 서로 다른 지표를 사용합니다. 예를 들어, 회귀 문제를 다루는 모델이라면, 평가 지표 중 하나는 평균 제곱 오차(MSE)입니다. 다양한 ML 문제 유형에 사용되는 모든 지표에 대한 자세한 내용은 [모델 품질 지표 및 Amazon CloudWatch 모니터링](model-monitor-model-quality-metrics.md)를 참조하세요.

모델 품질 모니터링은 데이터 품질 모니터링과 동일한 단계를 거치게 되지만, 여기에 Amazon S3의 실제 레이블을 실시간 추론 엔드포인트 또는 배치 변환 작업에서 캡처한 예측과 병합하는 단계가 추가됩니다. 모델 품질을 모니터링하려면 다음 단계를 따르세요.
+ 데이터 캡처를 활성화합니다. 이는 실시간 추론 엔드포인트 또는 배치 변환 작업에서 추론 입력 및 출력을 캡처한 다음, 해당 데이터를 Amazon S3에 저장합니다. 자세한 내용은 [데이터 캡처](model-monitor-data-capture.md)섹션을 참조하세요.
+ 기준을 생성합니다. 이 단계에서는 모델의 예측을 기준 데이터세트의 Ground Truth 레이블과 비교해보는 기준 작업을 실행합니다. 기준 작업은 모델 성능을 평가하는 데 기준이 되는 임계값을 정의하는 기준 통계 규칙 및 제약 조건을 자동으로 생성해줍니다. 자세한 내용은 [모델 품질 기준 만들기](model-monitor-model-quality-baseline.md)섹션을 참조하세요.
+ 모델 품질 모니터링 작업을 정의하고 스케줄링합니다. 모델 품질 모니터링 작업에 대한 특정 정보 및 코드 샘플은 [모델 품질 모니터링 작업 예약](model-monitor-model-quality-schedule.md) 섹션을 참조하세요. 작업 모니터링에 대한 일반적인 내용은 [모니터링 작업 일정 예약](model-monitor-scheduling.md)섹션을 참조하세요.
+ 모델 모니터가 실시간 추론 엔드포인트 또는 배치 변환 작업에서 캡처한 예측 데이터와 병합하게 될 Ground Truth 레이블을 수집합니다. 자세한 내용은 [Ground Truth 레이블을 수집하여 예측과 병합](model-monitor-model-quality-merge.md)섹션을 참조하세요.
+ 모델 품질 모니터링을 Amazon CloudWatch와 통합합니다. 자세한 내용은 [CloudWatch를 사용한 모델 품질 모니터링 지표](model-monitor-model-quality-metrics.md#model-monitor-model-quality-cw)섹션을 참조하세요.
+ 모니터링 작업의 결과물을 해석합니다. 자세한 내용은 [결과 해석](model-monitor-interpreting-results.md)섹션을 참조하세요.
+ SageMaker Studio를 사용하여 모델 품질 모니터링을 활성화하고 결과를 시각화합니다. 자세한 내용은 [Amazon SageMaker Studio에서 실시간 엔드포인트의 결과 시각화](model-monitor-interpreting-visualize-results.md)섹션을 참조하세요.

**Topics**
+ [모델 품질 기준 만들기](model-monitor-model-quality-baseline.md)
+ [모델 품질 모니터링 작업 예약](model-monitor-model-quality-schedule.md)
+ [Ground Truth 레이블을 수집하여 예측과 병합](model-monitor-model-quality-merge.md)
+ [모델 품질 지표 및 Amazon CloudWatch 모니터링](model-monitor-model-quality-metrics.md)

# 모델 품질 기준 만들기
<a name="model-monitor-model-quality-baseline"></a>

모델 예측을 사용자가 Amazon S3에 저장해둔 기준 데이터세트의 실측 레이블과 비교하는 기준 작업을 생성합니다. 일반적으로 훈련 데이터세트를 기준 데이터세트로 사용합니다. 기준 작업은 해당 모델에 대한 지표를 계산한 다음 모델 품질의 드리프트를 모니터링하는 데 사용할 제약 조건을 제안해줍니다.

기준 작업을 생성하려면, 모델이 수행한 예측이 포함된 데이터세트와 작업 데이터에 대한 Ground Truth를 나타내는 레이블이 준비되어야 합니다.

기준 작업을 생성하려면, SageMaker Python SDK에서 제공하는 `ModelQualityMonitor`클래스를 사용하여 다음 단계를 완료하세요.

**모델 품질 기준 작업 생성하기**

1.  먼저, `ModelQualityMonitor`클래스의 인스턴스를 생성합니다. 다음은 이를 수행하는 방법을 나타낸 코드 조각입니다.

   ```
   from sagemaker import get_execution_role, session, Session
   from sagemaker.model_monitor import ModelQualityMonitor
                   
   role = get_execution_role()
   session = Session()
   
   model_quality_monitor = ModelQualityMonitor(
       role=role,
       instance_count=1,
       instance_type='ml.m5.xlarge',
       volume_size_in_gb=20,
       max_runtime_in_seconds=1800,
       sagemaker_session=session
   )
   ```

1. 이제 `ModelQualityMonitor`객체의 `suggest_baseline`메서드를 호출하여 기준 작업을 실행합니다. 다음 코드 조각은 사용자가 Amazon S3에 저장된 예측과 레이블을 모두 포함하는 기준 데이터세트를 준비해 두었다고 가정합니다.

   ```
   baseline_job_name = "MyBaseLineJob"
   job = model_quality_monitor.suggest_baseline(
       job_name=baseline_job_name,
       baseline_dataset=baseline_dataset_uri, # The S3 location of the validation dataset.
       dataset_format=DatasetFormat.csv(header=True),
       output_s3_uri = baseline_results_uri, # The S3 location to store the results.
       problem_type='BinaryClassification',
       inference_attribute= "prediction", # The column in the dataset that contains predictions.
       probability_attribute= "probability", # The column in the dataset that contains probabilities.
       ground_truth_attribute= "label" # The column in the dataset that contains ground truth labels.
   )
   job.wait(logs=False)
   ```

1. 기준 작업이 완료되면, 해당 작업이 생성한 제약 조건을 볼 수 있습니다. 먼저, `ModelQualityMonitor`객체의 `latest_baselining_job`메서드를 호출하여 기준 작업의 결과를 가져옵니다.

   ```
   baseline_job = model_quality_monitor.latest_baselining_job
   ```

1. 기준 작업이 모니터링 측정값을 모델링하는 지표에 대한 임계값에 해당하는 제약 조건을 제안해줍니다. 지표가 제안된 임계값을 초과할 경우, Model Monitor는 위반을 보고합니다. 기준 작업에서 생성된 제약 조건을 보려면, 해당 기준 작업의 `suggested_constraints`메서드를 호출하세요. 다음 코드 조각은 바이너리 분류 모델을 위한 제약 조건을 Pandas 데이터프레임으로 로드합니다.

   ```
   import pandas as pd
   pd.DataFrame(baseline_job.suggested_constraints().body_dict["binary_classification_constraints"]).T
   ```

   생성된 제약 조건을 모니터링에 사용하기 전에 먼저 확인해보고 필요에 따라 수정하는 것이 좋습니다. 예를 들어, 제약 조건이 너무 강하면 위반에 대한 알림이 생각보다 많이 표시될 수 있습니다.

   제약 조건에 과학 표기법으로 표현된 숫자가 포함된 경우, 해당 숫자를 부동 소수점으로 변환해야 합니다. 다음 Python [사전 처리 스크립트](https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor-pre-and-post-processing.html#model-monitor-pre-processing-script) 예제는 과학 표기법으로 표현된 숫자를 부동 소수점으로 변환하는 방법을 보여줍니다.

   ```
   import csv
   
   def fix_scientific_notation(col):
       try:
           return format(float(col), "f")
       except:
           return col
   
   def preprocess_handler(csv_line):
       reader = csv.reader([csv_line])
       csv_record = next(reader)
       #skip baseline header, change HEADER_NAME to the first column's name
       if csv_record[0] == “HEADER_NAME”:
          return []
       return { str(i).zfill(20) : fix_scientific_notation(d) for i, d in enumerate(csv_record)}
   ```

   사전 처리 스크립트는 [Model Monitor](https://sagemaker.readthedocs.io/en/stable/api/inference/model_monitor.html) 설명서에 정의된 대로 `record_preprocessor_script`의 형태로 기준 또는 모니터링 일정에 추가하는 것이 가능합니다.

1. 제약 조건에 만족한다면, 모니터링 일정을 생성할 때 해당 제약 조건을 `constraints`매개변수로서 전달하세요. 자세한 내용은 [모델 품질 모니터링 작업 예약](model-monitor-model-quality-schedule.md)섹션을 참조하세요.

제안된 기준 제약 조건은 사용자가 `output_s3_uri`를 통해 지정한 위치의 constraints.json 파일에 포함되어 있습니다. 이 파일의 스키마에 대한 자세한 내용은 [제약 조건에 대한 스키마(constraints.json 파일)](model-monitor-byoc-constraints.md)섹션을 참조하세요.

# 모델 품질 모니터링 작업 예약
<a name="model-monitor-model-quality-schedule"></a>

기준 생성을 마쳤다면, `ModelQualityMonitor`클래스 인스턴스의 `create_monitoring_schedule()`메서드를 호출하여 시간별 모델 품질 모니터를 예약할 수 있습니다. 다음 섹션은 실시간 엔드포인트에 배포된 모델 및 배치 변환 작업에 사용할 모델 품질 모니터를 생성하는 방법을 보여줍니다.

**중요**  
모니터링 일정을 생성할 때는 배치 변환 입력이나 엔드포인트 입력 중에서 하나를 지정할 수 있지만, 둘 다 지정할 수는 없습니다.

데이터 품질 모니터링과는 달리, 모델 품질을 모니터링하려면 Ground Truth 레이블을 제공해야 합니다. 그러나 Ground Truth 레이블은 지연될 수 있습니다. 이 문제를 해결하려면, 모니터링 일정을 생성할 때 오프셋을 지정하세요.

## 모델 모니터 오프셋
<a name="model-monitor-model-quality-schedule-offsets"></a>

모델 품질 작업에는 `StartTimeOffset`및 `EndTimeOffset`이 포함되며, 이는 `create_model_quality_job_definition`메서드의 `ModelQualityJobInput`매개변수 필드로서 다음과 같이 작동합니다.
+ `StartTimeOffset` - 지정된 경우, 작업의 시작 시간으로부터 이만큼의 시간이 차감됩니다.
+ `EndTimeOffset` - 지정된 경우, 작업의 종료 시간으로부터 이만큼의 시간이 차감됩니다.

오프셋 형식은 예컨대 -PT7H와 같이 표기되며, 여기서 7H는 7시간을 의미합니다. -PT\$1H 또는 -P\$1D 형식으로 사용이 가능하며, 여기서 H=시간, D=일, M=분이고, \$1은 숫자입니다. 또한 오프셋은 [ISO 8601 지속시간 형식](https://en.wikipedia.org/wiki/ISO_8601#Durations)을 사용해야 합니다.

예를 들어, 해당 Ground Truth가 1일이 지난 후부터 들어오기 시작하지만 일주일 안에는 완료되지 않는 경우라면, `StartTimeOffset`을 `-P8D`로, `EndTimeOffset`을 `-P1D`로 설정하세요. 그런 다음에 작업 실행 시점을 `2020-01-09T13:00`로 예약한다면, `2020-01-01T13:00`\$1`2020-01-08T13:00`사이의 데이터가 분석됩니다.

**중요**  
일정 케이던스는 다음 번의 실행이 시작되기 전에 한 가지 실행이 먼저 완료되는 형태로 설정해야 하며, 이렇게 해야 실행 시 Ground Truth 병합 작업과 모니터링 작업이 완료될 수 있습니다. 실행의 최대 런타임은 두 작업으로 나누어지기 때문에, 시간별 모델 품질 모니터링 작업에서의 경우 `StoppingCondition`의 일부로서 지정된 `MaxRuntimeInSeconds`의 값은 1800을 넘지 않아야 합니다.

## 실시간 엔드포인트에 배포된 모델에 대한 모델 품질 모니터링
<a name="model-monitor-data-quality-schedule-rt"></a>

실시간 엔드포인트에 대한 모델 품질 모니터를 예약하려면, 다음 코드 샘플에 나와 있는 것처럼 `EndpointInput`인스턴스를 `ModelQualityMonitor`인스턴스의 `endpoint_input`인수로 전달하세요.

```
from sagemaker.model_monitor import CronExpressionGenerator
                    
model_quality_model_monitor = ModelQualityMonitor(
   role=sagemaker.get_execution_role(),
   ...
)

schedule = model_quality_model_monitor.create_monitoring_schedule(
   monitor_schedule_name=schedule_name,
   post_analytics_processor_script=s3_code_postprocessor_uri,
   output_s3_uri=s3_report_path,
   schedule_cron_expression=CronExpressionGenerator.hourly(),    
   statistics=model_quality_model_monitor.baseline_statistics(),
   constraints=model_quality_model_monitor.suggested_constraints(),
   schedule_cron_expression=CronExpressionGenerator.hourly(),
   enable_cloudwatch_metrics=True,
   endpoint_input=EndpointInput(
        endpoint_name=endpoint_name,
        destination="/opt/ml/processing/input/endpoint",
        start_time_offset="-PT2D",
        end_time_offset="-PT1D",
    )
)
```

## 배치 변환 작업에 대한 모델 품질 모니터링
<a name="model-monitor-data-quality-schedule-tt"></a>

배치 변환 작업에 대한 모델 품질 모니터를 예약하려면, 다음 코드 샘플에 나와 있는 것처럼 `BatchTransformInput`인스턴스를 `ModelQualityMonitor`인스턴스의 `batch_transform_input`인수로 전달하세요.

```
from sagemaker.model_monitor import CronExpressionGenerator

model_quality_model_monitor = ModelQualityMonitor(
   role=sagemaker.get_execution_role(),
   ...
)

schedule = model_quality_model_monitor.create_monitoring_schedule(
    monitor_schedule_name=mon_schedule_name,
    batch_transform_input=BatchTransformInput(
        data_captured_destination_s3_uri=s3_capture_upload_path,
        destination="/opt/ml/processing/input",
        dataset_format=MonitoringDatasetFormat.csv(header=False),
        # the column index of the output representing the inference probablity
        probability_attribute="0",
        # the threshold to classify the inference probablity to class 0 or 1 in 
        # binary classification problem
        probability_threshold_attribute=0.5,
        # look back 6 hour for transform job outputs.
        start_time_offset="-PT6H",
        end_time_offset="-PT0H"
    ),
    ground_truth_input=gt_s3_uri,
    output_s3_uri=s3_report_path,
    problem_type="BinaryClassification",
    constraints = constraints_path,
    schedule_cron_expression=CronExpressionGenerator.hourly(),
    enable_cloudwatch_metrics=True,
)
```

# Ground Truth 레이블을 수집하여 예측과 병합
<a name="model-monitor-model-quality-merge"></a>

모델 품질 모니터링은 모델의 품질을 측정하기 위해 해당 모델이 수행한 예측과 실측 레이블을 비교하게 됩니다. 이렇게 하려면, 엔드포인트에서 캡처된 데이터 또는 배치 변환 작업에 주기적으로 레이블을 지정한 다음 이를 Amazon S3에 업로드해야 합니다.

Ground Truth 레이블을 캡처된 예측 데이터와 일치시키려면, 해당 데이터 세트 내의 개별 레코드마다 고유한 식별자가 있어야 합니다. 실측 데이터에 대한 각 레코드의 구조는 다음과 같습니다.

```
{
  "groundTruthData": {
    "data": "1",
    "encoding": "CSV"
  },
  "eventMetadata": {
    "eventId": "aaaa-bbbb-cccc"
  },
  "eventVersion": "0"
}
```

`groundTruthData` 구조에서, `eventId`는 다음 중 하나일 수 있습니다.
+ `eventId` - 이 ID는 사용자가 엔드포인트를 호출할 때 자동으로 생성됩니다.
+ `inferenceId` – 발신자 측에서 엔드포인트를 호출할 때 이 ID를 제공합니다.

캡처된 데이터 레코드에 `inferenceId`가 있는 경우, Model Monitor는 이를 사용하여 캡처된 데이터를 Ground Truth 레코드와 병합합니다. 사용자는 Ground Truth 레코드에 있는 `inferenceId`가 캡처된 레코드에 포함된 `inferenceId`와 일치하는지 여부를 직접 확인해야 합니다. 만약 캡처된 데이터에 `inferenceId`가 없다면, 모델 모니터는 캡처된 데이터 레코드의 `eventId`를 사용하여 Ground Truth 레코드와 일치시키게 됩니다.

Ground Truth 데이터를 Amazon S3 버킷에 업로드할 때는 반드시 캡처된 데이터와 경로 형식이 동일해야 합니다.

**데이터 형식 요구 사항**  
Amazon S3에 데이터를 저장할 때는 jsonlines 형식(.jsonl)을 사용하고 다음 명명 구조를 사용하여 저장해야 합니다. jsonline 요구 사항에 대한 자세한 내용은 [입력 및 출력 데이터 사용](sms-data.md) 섹션을 참조하세요.

```
s3://amzn-s3-demo-bucket1/prefix/yyyy/mm/dd/hh
```

이 경로의 날짜는 Ground Truth 레이블이 수집된 날짜에 해당하며, 추론이 생성된 날짜와는 반드시 일치하지 않아도 됩니다.

Ground Truth 레이블을 생성하여 업로드를 마쳤다면, 모니터링 작업을 생성하는 단계에서 해당 레이블의 위치를 매개변수로 포함시키세요. 를 사용하는 경우 `create_model_quality_job_definition` 메서드 호출에서 Ground Truth 레이블의 위치를 `GroundTruthS3Input` 파라미터의 `S3Uri` 필드로 지정하여이 작업을 AWS SDK for Python (Boto3)수행합니다. 현재 SageMaker Python SDK를 사용 중이라면, `ModelQualityMonitor`객체의 `create_monitoring_schedule`호출 시 Ground Truth 레이블의 위치를 `ground_truth_input`매개변수로서 지정하세요.

# 모델 품질 지표 및 Amazon CloudWatch 모니터링
<a name="model-monitor-model-quality-metrics"></a>

모델 품질 모니터링 작업은 다양한 지표를 계산하여 기계 학습 모델의 품질과 성능을 평가합니다. 계산된 특정 지표는 회귀, 바이너리 분류 또는 멀티클래스 분류와 같은 ML 문제의 유형에 따라 달라집니다. 시간 경과에 따른 모델 드리프트를 감지하려면 이러한 지표를 모니터링하는 것이 중요합니다. 다음 섹션에서는 각 문제 유형에 대한 주요 모델 품질 지표와 CloudWatch를 사용하여 모델의 성능을 지속적으로 추적하는 자동 모니터링 및 알림을 설정하는 방법을 다룹니다.

**참고**  
지표의 표준 편차는 최소한 200개 이상의 샘플을 사용할 수 있는 경우에만 제공됩니다. Model Monitor가 표준 편차를 계산하는 방식은 계산 데이터의 80%를 5회 랜덤하게 샘플링하고 지표를 계산한 다음 해당 결과에 대한 표준 편차를 취하는 것입니다.

## 회귀 지표
<a name="model-monitor-model-quality-metrics-regression"></a>

다음 예제는 모델 품질 모니터가 회귀 문제에 대해 계산을 수행하는 경우의 지표를 보여줍니다.

```
"regression_metrics" : {
    "mae" : {
      "value" : 0.3711832061068702,
      "standard_deviation" : 0.0037566388129940394
    },
    "mse" : {
      "value" : 0.3711832061068702,
      "standard_deviation" : 0.0037566388129940524
    },
    "rmse" : {
      "value" : 0.609248066149471,
      "standard_deviation" : 0.003079253267651125
    },
    "r2" : {
      "value" : -1.3766111872212665,
      "standard_deviation" : 0.022653980022771227
    }
  }
```

## 바이너리 분류 지표
<a name="model-monitor-model-quality-metrics-binary"></a>

다음 예제는 모델 품질 모니터가 바이너리 분류 문제에 대해 계산을 수행하는 경우의 지표를 보여줍니다.

```
"binary_classification_metrics" : {
    "confusion_matrix" : {
      "0" : {
        "0" : 1,
        "1" : 2
      },
      "1" : {
        "0" : 0,
        "1" : 1
      }
    },
    "recall" : {
      "value" : 1.0,
      "standard_deviation" : "NaN"
    },
    "precision" : {
      "value" : 0.3333333333333333,
      "standard_deviation" : "NaN"
    },
    "accuracy" : {
      "value" : 0.5,
      "standard_deviation" : "NaN"
    },
    "recall_best_constant_classifier" : {
      "value" : 1.0,
      "standard_deviation" : "NaN"
    },
    "precision_best_constant_classifier" : {
      "value" : 0.25,
      "standard_deviation" : "NaN"
    },
    "accuracy_best_constant_classifier" : {
      "value" : 0.25,
      "standard_deviation" : "NaN"
    },
    "true_positive_rate" : {
      "value" : 1.0,
      "standard_deviation" : "NaN"
    },
    "true_negative_rate" : {
      "value" : 0.33333333333333337,
      "standard_deviation" : "NaN"
    },
    "false_positive_rate" : {
      "value" : 0.6666666666666666,
      "standard_deviation" : "NaN"
    },
    "false_negative_rate" : {
      "value" : 0.0,
      "standard_deviation" : "NaN"
    },
    "receiver_operating_characteristic_curve" : {
      "false_positive_rates" : [ 0.0, 0.0, 0.0, 0.0, 0.0, 1.0 ],
      "true_positive_rates" : [ 0.0, 0.25, 0.5, 0.75, 1.0, 1.0 ]
    },
    "precision_recall_curve" : {
      "precisions" : [ 1.0, 1.0, 1.0, 1.0, 1.0 ],
      "recalls" : [ 0.0, 0.25, 0.5, 0.75, 1.0 ]
    },
    "auc" : {
      "value" : 1.0,
      "standard_deviation" : "NaN"
    },
    "f0_5" : {
      "value" : 0.3846153846153846,
      "standard_deviation" : "NaN"
    },
    "f1" : {
      "value" : 0.5,
      "standard_deviation" : "NaN"
    },
    "f2" : {
      "value" : 0.7142857142857143,
      "standard_deviation" : "NaN"
    },
    "f0_5_best_constant_classifier" : {
      "value" : 0.29411764705882354,
      "standard_deviation" : "NaN"
    },
    "f1_best_constant_classifier" : {
      "value" : 0.4,
      "standard_deviation" : "NaN"
    },
    "f2_best_constant_classifier" : {
      "value" : 0.625,
      "standard_deviation" : "NaN"
    }
  }
```

## 멀티클래스 지표
<a name="model-monitor-model-quality-metrics-multi"></a>

다음 예제는 모델 품질 모니터가 멀티클래스 분류 문제에 대해 계산을 수행하는 경우의 지표를 보여줍니다.

```
"multiclass_classification_metrics" : {
    "confusion_matrix" : {
      "0" : {
        "0" : 1180,
        "1" : 510
      },
      "1" : {
        "0" : 268,
        "1" : 138
      }
    },
    "accuracy" : {
      "value" : 0.6288167938931297,
      "standard_deviation" : 0.00375663881299405
    },
    "weighted_recall" : {
      "value" : 0.6288167938931297,
      "standard_deviation" : 0.003756638812994008
    },
    "weighted_precision" : {
      "value" : 0.6983172269629505,
      "standard_deviation" : 0.006195912915307507
    },
    "weighted_f0_5" : {
      "value" : 0.6803947317178771,
      "standard_deviation" : 0.005328406973561699
    },
    "weighted_f1" : {
      "value" : 0.6571162346664904,
      "standard_deviation" : 0.004385008075019733
    },
    "weighted_f2" : {
      "value" : 0.6384024354394601,
      "standard_deviation" : 0.003867109755267757
    },
    "accuracy_best_constant_classifier" : {
      "value" : 0.19370229007633588,
      "standard_deviation" : 0.0032049848450732355
    },
    "weighted_recall_best_constant_classifier" : {
      "value" : 0.19370229007633588,
      "standard_deviation" : 0.0032049848450732355
    },
    "weighted_precision_best_constant_classifier" : {
      "value" : 0.03752057718081697,
      "standard_deviation" : 0.001241536088657851
    },
    "weighted_f0_5_best_constant_classifier" : {
      "value" : 0.04473443104152011,
      "standard_deviation" : 0.0014460485504284792
    },
    "weighted_f1_best_constant_classifier" : {
      "value" : 0.06286421244683643,
      "standard_deviation" : 0.0019113576884608862
    },
    "weighted_f2_best_constant_classifier" : {
      "value" : 0.10570313141262414,
      "standard_deviation" : 0.002734216826748117
    }
  }
```

## CloudWatch를 사용한 모델 품질 모니터링 지표
<a name="model-monitor-model-quality-cw"></a>

모니터링 일정을 만들 때 `enable_cloudwatch_metrics`의 값을 `True`로 설정하면, 모델 품질 모니터링 작업은 모든 지표를 CloudWatch로 전송하게 됩니다.

모델 품질 지표는 다음 네임스페이스에 표시됩니다.
+ 실시간 엔드포인트인 경우: `aws/sagemaker/Endpoints/model-metrics`
+ 배치 변환 작업인 경우: `aws/sagemaker/ModelMonitoring/model-metrics`

방출되는 지표 목록은 이 페이지의 이전 섹션을 참조하세요.

CloudWatch 지표를 사용하면, 사용자가 지정한 임계값을 특정 지표가 충족하지 못할 경우 이를 알려주는 경보를 생성할 수 있습니다. CloudWatch 경보를 만드는 방법에 대한 지침은 *CloudWatch 사용 설명서*의 [정적 임곗값을 기반으로 CloudWatch 경보 생성](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ConsoleAlarms.html) 섹션을 참조하세요.