Cartões SageMaker modelo da Amazon - Amazon SageMaker

As traduções são geradas por tradução automática. Em caso de conflito entre o conteúdo da tradução e da versão original em inglês, a versão em inglês prevalecerá.

Cartões SageMaker modelo da Amazon

Importante

O Amazon SageMaker Model Card é integrado ao SageMaker Model Registry. Se você estiver registrando um modelo no Model Registry, poderá usar a integração para adicionar informações de auditoria. Para obter mais informações, consulte Exibir e atualizar os detalhes de uma versão do modelo.

Use os Amazon SageMaker Model Cards para documentar detalhes críticos sobre seus modelos de aprendizado de máquina (ML) em um único local para simplificar a governança e a geração de relatórios.

Detalhes do catálogo, como o uso pretendido e a classificação de risco de um modelo, detalhes e métricas de treinamento, resultados e observações da avaliação e explicações adicionais, como considerações, recomendações e informações personalizadas. Ao criar cartões de modelo, você pode fazer o seguinte:

  • Fornecer orientação sobre como um modelo deve ser usado.

  • Dar suporte a atividades de auditoria com descrições detalhadas do treinamento e performance do modelo.

  • Comunique como um modelo se destina a apoiar as metas de negócios.

Os cartões de modelo fornecem orientação prescritiva sobre quais informações documentar e incluem campos para informações personalizadas. Depois de criar um cartão modelo, você pode exportá-lo para um PDF ou baixá-lo para compartilhar com as partes interessadas relevantes. Qualquer edição que não seja uma atualização do status da aprovação feita em um cartão de modelo resultará em versões adicionais do cartão de modelo para ter um registro imutável das alterações do modelo.

Pré-requisitos

Para começar a usar os cartões SageMaker modelo da Amazon, você deve ter permissão para criar, editar, visualizar e exportar cartões modelo.

Usos pretendidos de um modelo

Especificar os usos pretendidos de um modelo ajuda a garantir que os desenvolvedores e usuários do modelo tenham as informações necessárias para treinar ou implantar o modelo com responsabilidade. Os usos pretendidos de um modelo devem descrever os cenários nos quais o modelo é apropriado para uso, bem como os cenários nos quais o modelo não é recomendado.

Recomendamos incluir:

  • O propósito geral do modelo

  • Casos de uso para os quais o modelo foi destinado

  • Casos de uso para os quais o modelo não foi projetado

  • Suposições feitas ao desenvolver o modelo

Os usos pretendidos de um modelo vão além dos detalhes técnicos e descrevem como um modelo deve ser usado na produção, os cenários nos quais é apropriado usar um modelo e considerações adicionais, como o tipo de dados a ser usado com o modelo ou quaisquer suposições feitas durante o desenvolvimento.

Classificações de risco

Os desenvolvedores criam modelos de ML para casos de uso com níveis variados de risco. Por exemplo, um modelo que aprova pedidos de empréstimo pode ser um modelo de maior risco do que aquele que detecta a categoria de um e-mail. Dados os diversos perfis de risco de um modelo, os cartões de modelo fornecem um campo para você categorizar a classificação de risco de um modelo.

Essa classificação de risco pode ser unknown, low, medium ou high. Use esses campos de classificação de risco para rotular modelos desconhecidos, de baixo, médio ou alto risco e ajudar sua organização a cumprir todas as regras existentes sobre a colocação de determinados modelos em produção.

JSONEsquema do cartão modelo

Os detalhes da avaliação de um modelo de cartão devem ser fornecidos em JSON formato. Se você já tiver relatórios de avaliação em JSON formato gerados pelo SageMaker Clarify ou pelo SageMaker Model Monitor, faça o upload deles para o Amazon S3 e forneça um S3 URI para analisar automaticamente as métricas de avaliação. Para obter mais informações e exemplos de relatórios, consulte a pasta de métricas de exemplo no caderno de exemplos de Amazon SageMaker Model Governance - Model Cards.

Ao criar um cartão de modelo usando o SageMaker PythonSDK, o conteúdo do modelo deve estar no JSON esquema do cartão de modelo e ser fornecido como uma string. Forneça conteúdo de modelo semelhante ao seguinte exemplo.

{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://json-schema.org/draft-07/schema#", "title": "SageMakerModelCardSchema", "description": "Default model card schema", "version": "0.1.0", "type": "object", "additionalProperties": false, "properties": { "model_overview": { "description": "Overview about the model", "type": "object", "additionalProperties": false, "properties": { "model_description": { "description": "description of model", "type": "string", "maxLength": 1024 }, "model_owner": { "description": "Owner of model", "type": "string", "maxLength": 1024 }, "model_creator": { "description": "Creator of model", "type": "string", "maxLength": 1024 }, "problem_type": { "description": "Problem being solved with the model", "type": "string" }, "algorithm_type": { "description": "Algorithm used to solve the problem", "type": "string", "maxLength": 1024 }, "problem_type": { "description": "Problem being solved with the model", "type": "string" }, "model_owner": { "description": "Owner of model", "type": "string", "maxLength": 1024 } }, "model_id": { "description": "SageMaker Model Arn or Non SageMaker Model id", "type": "string", "maxLength": 1024 }, "model_artifact": { "description": "Location of the model artifact", "type": "array", "maxContains": 15, "items": { "type": "string", "maxLength": 1024 } }, "model_name": { "description": "Name of the model", "type": "string", "maxLength": 1024 }, "model_version": { "description": "Version of the model", "type": "number", "minimum": 1 }, "inference_environment": { "description": "Overview about the inference", "type": "object", "additionalProperties": false, "properties": { "container_image": { "description": "SageMaker inference image uri", "type": "array", "maxContains": 15, "items": { "type": "string", "maxLength": 1024 } } } } } }, "model_package_details": { "description": "Metadata information related to model package version", "type": "object", "additionalProperties": false, "properties": { "model_package_description": { "description": "A brief summary of the model package", "type": "string", "maxLength": 1024 }, "model_package_arn": { "description": "The Amazon Resource Name (ARN) of the model package", "type": "string", "minLength": 1, "maxLength": 2048 }, "created_by": { "description": "Information about the user who created model package.", "type": "object", "additionalProperties": false, "properties": { "user_profile_name": { "description": "The name of the user's profile in SageMaker Studio", "type": "string", "maxLength": 63 } } }, "model_package_status": { "description": "Current status of model package", "type": "string", "enum": [ "Pending", "InProgress", "Completed", "Failed", "Deleting" ] }, "model_approval_status": { "description": "Current approval status of model package", "type": "string", "enum": [ "Approved", "Rejected", "PendingManualApproval" ] }, "approval_description": { "description": "A description provided for the model approval", "type": "string", "maxLength": 1024 }, "model_package_group_name": { "description": "If the model is a versioned model, the name of the model group that the versioned model belongs to.", "type": "string", "minLength": 1, "maxLength": 63 }, "model_package_name": { "description": "Name of the model package", "type": "string", "minLength": 1, "maxLength": 63 }, "model_package_version": { "description": "Version of the model package", "type": "number", "minimum": 1 }, "domain": { "description": "The machine learning domain of the model package you specified. Common machine learning domains include computer vision and natural language processing.", "type": "string" }, "task": { "description": "The machine learning task you specified that your model package accomplishes. Common machine learning tasks include object detection and image classification.", "type": "string" }, "source_algorithms": { "description": "A list of algorithms that were used to create a model package.", "$ref": "#/definitions/source_algorithms" }, "inference_specification": { "description": "Details about inference jobs that can be run with models based on this model package.", "$ref": "#/definitions/inference_specification" } } }, "intended_uses": { "description": "Intended usage of model", "type": "object", "additionalProperties": false, "properties": { "purpose_of_model": { "description": "Why the model was developed?", "type": "string", "maxLength": 2048 }, "intended_uses": { "description": "intended use cases", "type": "string", "maxLength": 2048 }, "factors_affecting_model_efficiency": { "type": "string", "maxLength": 2048 }, "risk_rating": { "description": "Risk rating for model card", "$ref": "#/definitions/risk_rating" }, "explanations_for_risk_rating": { "type": "string", "maxLength": 2048 } } }, "business_details": { "description": "Business details of model", "type": "object", "additionalProperties": false, "properties": { "business_problem": { "description": "What business problem does the model solve?", "type": "string", "maxLength": 2048 }, "business_stakeholders": { "description": "Business stakeholders", "type": "string", "maxLength": 2048 }, "line_of_business": { "type": "string", "maxLength": 2048 } } }, "training_details": { "description": "Overview about the training", "type": "object", "additionalProperties": false, "properties": { "objective_function": { "description": "the objective function the model will optimize for", "function": { "$ref": "#/definitions/objective_function" }, "notes": { "type": "string", "maxLength": 1024 } }, "training_observations": { "type": "string", "maxLength": 1024 }, "training_job_details": { "type": "object", "additionalProperties": false, "properties": { "training_arn": { "description": "SageMaker Training job arn", "type": "string", "maxLength": 1024 }, "training_datasets": { "description": "Location of the model datasets", "type": "array", "maxContains": 15, "items": { "type": "string", "maxLength": 1024 } }, "training_environment": { "type": "object", "additionalProperties": false, "properties": { "container_image": { "description": "SageMaker training image uri", "type": "array", "maxContains": 15, "items": { "type": "string", "maxLength": 1024 } } } }, "training_metrics": { "type": "array", "items": { "maxItems": 50, "$ref": "#/definitions/training_metric" } }, "user_provided_training_metrics": { "type": "array", "items": { "maxItems": 50, "$ref": "#/definitions/training_metric" } }, "hyper_parameters": { "type": "array", "items": { "maxItems": 100, "$ref": "#/definitions/training_hyper_parameter" } }, "user_provided_hyper_parameters": { "type": "array", "items": { "maxItems": 100, "$ref": "#/definitions/training_hyper_parameter" } } } } } }, "evaluation_details": { "type": "array", "default": [], "items": { "type": "object", "required": [ "name" ], "additionalProperties": false, "properties": { "name": { "type": "string", "pattern": ".{1,63}" }, "evaluation_observation": { "type": "string", "maxLength": 2096 }, "evaluation_job_arn": { "type": "string", "maxLength": 256 }, "datasets": { "type": "array", "items": { "type": "string", "maxLength": 1024 }, "maxItems": 10 }, "metadata": { "description": "additional attributes associated with the evaluation results", "type": "object", "additionalProperties": { "type": "string", "maxLength": 1024 } }, "metric_groups": { "type": "array", "default": [], "items": { "type": "object", "required": [ "name", "metric_data" ], "properties": { "name": { "type": "string", "pattern": ".{1,63}" }, "metric_data": { "type": "array", "items": { "anyOf": [ { "$ref": "#/definitions/simple_metric" }, { "$ref": "#/definitions/linear_graph_metric" }, { "$ref": "#/definitions/bar_chart_metric" }, { "$ref": "#/definitions/matrix_metric" } ] } } } } } } } }, "additional_information": { "additionalProperties": false, "type": "object", "properties": { "ethical_considerations": { "description": "Any ethical considerations that the author wants to provide", "type": "string", "maxLength": 2048 }, "caveats_and_recommendations": { "description": "Caveats and recommendations for people who might use this model in their applications.", "type": "string", "maxLength": 2048 }, "custom_details": { "type": "object", "additionalProperties": { "$ref": "#/definitions/custom_property" } } } } }, "definitions": { "source_algorithms": { "type": "array", "minContains": 1, "maxContains": 1, "items": { "type": "object", "additionalProperties": false, "required": [ "algorithm_name" ], "properties": { "algorithm_name": { "description": "The name of an algorithm that was used to create the model package. The algorithm must be either an algorithm resource in your SageMaker account or an algorithm in AWS Marketplace that you are subscribed to.", "type": "string", "maxLength": 170 }, "model_data_url": { "description": "The Amazon S3 path where the model artifacts, which result from model training, are stored.", "type": "string", "maxLength": 1024 } } } }, "inference_specification": { "type": "object", "additionalProperties": false, "required": [ "containers" ], "properties": { "containers": { "description": "Contains inference related information which were used to create model package.", "type": "array", "minContains": 1, "maxContains": 15, "items": { "type": "object", "additionalProperties": false, "required": [ "image" ], "properties": { "model_data_url": { "description": "The Amazon S3 path where the model artifacts, which result from model training, are stored.", "type": "string", "maxLength": 1024 }, "image": { "description": "Inference environment path. The Amazon EC2 Container Registry (Amazon ECR) path where inference code is stored.", "type": "string", "maxLength": 255 }, "nearest_model_name": { "description": "The name of a pre-trained machine learning benchmarked by Amazon SageMaker Inference Recommender model that matches your model.", "type": "string" } } } } } }, "risk_rating": { "description": "Risk rating of model", "type": "string", "enum": [ "High", "Medium", "Low", "Unknown" ] }, "custom_property": { "description": "Additional property in section", "type": "string", "maxLength": 1024 }, "objective_function": { "description": "objective function that training job is optimized for", "additionalProperties": false, "properties": { "function": { "type": "string", "enum": [ "Maximize", "Minimize" ] }, "facet": { "type": "string", "maxLength": 63 }, "condition": { "type": "string", "maxLength": 63 } } }, "training_metric": { "description": "training metric data", "type": "object", "required": [ "name", "value" ], "additionalProperties": false, "properties": { "name": { "type": "string", "pattern": ".{1,255}" }, "notes": { "type": "string", "maxLength": 1024 }, "value": { "type": "number" } } }, "training_hyper_parameter": { "description": "training hyper parameter", "type": "object", "required": [ "name", "value" ], "additionalProperties": false, "properties": { "name": { "type": "string", "pattern": ".{1,255}" }, "value": { "type": "string", "pattern": ".{1,255}" } } }, "linear_graph_metric": { "type": "object", "required": [ "name", "type", "value" ], "additionalProperties": false, "properties": { "name": { "type": "string", "pattern": ".{1,255}" }, "notes": { "type": "string", "maxLength": 1024 }, "type": { "type": "string", "enum": [ "linear_graph" ] }, "value": { "anyOf": [ { "type": "array", "items": { "type": "array", "items": { "type": "number" }, "minItems": 2, "maxItems": 2 }, "minItems": 1 } ] }, "x_axis_name": { "$ref": "#/definitions/axis_name_string" }, "y_axis_name": { "$ref": "#/definitions/axis_name_string" } } }, "bar_chart_metric": { "type": "object", "required": [ "name", "type", "value" ], "additionalProperties": false, "properties": { "name": { "type": "string", "pattern": ".{1,255}" }, "notes": { "type": "string", "maxLength": 1024 }, "type": { "type": "string", "enum": [ "bar_chart" ] }, "value": { "anyOf": [ { "type": "array", "items": { "type": "number" }, "minItems": 1 } ] }, "x_axis_name": { "$ref": "#/definitions/axis_name_array" }, "y_axis_name": { "$ref": "#/definitions/axis_name_string" } } }, "matrix_metric": { "type": "object", "required": [ "name", "type", "value" ], "additionalProperties": false, "properties": { "name": { "type": "string", "pattern": ".{1,255}" }, "notes": { "type": "string", "maxLength": 1024 }, "type": { "type": "string", "enum": [ "matrix" ] }, "value": { "anyOf": [ { "type": "array", "items": { "type": "array", "items": { "type": "number" }, "minItems": 1, "maxItems": 20 }, "minItems": 1, "maxItems": 20 } ] }, "x_axis_name": { "$ref": "#/definitions/axis_name_array" }, "y_axis_name": { "$ref": "#/definitions/axis_name_array" } } }, "simple_metric": { "description": "metric data", "type": "object", "required": [ "name", "type", "value" ], "additionalProperties": false, "properties": { "name": { "type": "string", "pattern": ".{1,255}" }, "notes": { "type": "string", "maxLength": 1024 }, "type": { "type": "string", "enum": [ "number", "string", "boolean" ] }, "value": { "anyOf": [ { "type": "number" }, { "type": "string", "maxLength": 63 }, { "type": "boolean" } ] }, "x_axis_name": { "$ref": "#/definitions/axis_name_string" }, "y_axis_name": { "$ref": "#/definitions/axis_name_string" } } }, "axis_name_array": { "type": "array", "items": { "type": "string", "maxLength": 63 } }, "axis_name_string": { "type": "string", "maxLength": 63 } } }