aws-samples / aws-samples/amazon-sagemaker-drift-detection
feat: Create Lambda to query Training job
- Dominant language
- Python
- Stars
- 66
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Description
Replace the `evaluate.py` processing job with a [Lambda Step](https://docs.aws.amazon.com/sagemaker/latest/dg/build-and-manage-steps.html#step-type-lambda) that returns the report dictionary [Model Quality Metrics](https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor-model-quality-metrics.html)
```
# Get the training job
response = sm_client.describe_training_job(TrainingJobName=job_name)
status = response["TrainingJobStatus"]
logger.info("Training job:{} has status:{}.".format(job_name, status))
# Get the metrics as a dictionary
report_dict = {
"regression_metrics": { }
}
for metric in response["FinalMetricDataList"]:
report_dict["regression_metrics"][metric["MetricName"]] = metric["Value"]
```
Contributor guide
Assessment
This issue has not been assessed yet.