SageMaker / Client / get_candidate

get_candidate

SageMaker.Client.get_candidate(**kwargs)

Returns information about a candidate on a leaderboard, including all of its evaluation metrics.

See also: AWS API Documentation

Request Syntax

response = client.get_candidate(
    LeaderboardArn='string',
    CandidateId='string'
)
Parameters:
  • LeaderboardArn (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the leaderboard that the candidate belongs to.

  • CandidateId (string) –

    [REQUIRED]

    The ID of the candidate.

Return type:

dict

Returns:

Response Syntax

{
    'CandidateId': 'string',
    'LeaderboardArn': 'string',
    'DisplayName': 'string',
    'Labels': {
        'string': 'string'
    },
    'CandidateConfig': {
        'CustomerModelConfig': {
            'ModelRef': 'string',
            'DatasetArn': 'string',
            'EvalCriteriaArn': 'string',
            'PromptTemplateArn': 'string',
            'Dimensions': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        }
    },
    'EvaluationResults': [
        {
            'CriterionName': 'string',
            'Metrics': {
                'string': 123.0
            },
            'Producer': 'MLFLOW'|'EXTERNAL',
            'SourceId': 'string',
            'SourceUrl': 'string',
            'References': {
                'string': 'string'
            },
            'RecordedAt': datetime(2015, 1, 1),
            'IngestedAt': datetime(2015, 1, 1)
        },
    ],
    'CreationTime': datetime(2015, 1, 1),
    'LastModifiedTime': datetime(2015, 1, 1)
}

Response Structure

  • (dict) –

    • CandidateId (string) –

      The ID of the candidate.

    • LeaderboardArn (string) –

      The Amazon Resource Name (ARN) of the leaderboard that the candidate belongs to.

    • DisplayName (string) –

      The display name of the candidate.

    • Labels (dict) –

      The labels of the candidate.

      • (string) –

        • (string) –

    • CandidateConfig (dict) –

      The configuration that identifies the candidate.

      • CustomerModelConfig (dict) –

        The configuration of a candidate that is one of your models.

        • ModelRef (string) –

          A reference to the model that was evaluated, such as the ARN of a SageMaker model package or a model identifier.

        • DatasetArn (string) –

          The dataset the candidate was evaluated on: the ARN of a SageMaker hub content DataSet, or the S3 URI of the dataset. Optional.

        • EvalCriteriaArn (string) –

          The ARN of the evaluation criteria that the candidate was evaluated with. Specify the ARN of a SageMaker hub content document of type JsonDoc, optionally with its version, for example arn:aws:sagemaker:aa-example-3:111122223333:hub-content/my-hub/JsonDoc/my-criteria/1.0.0. For content in a public hub, the account is aws.

        • PromptTemplateArn (string) –

          The Amazon Resource Name (ARN) of the prompt template that you use with the model. Optional. Specify the ARN of a SageMaker hub content document or of an Amazon Bedrock prompt, such as a prompt version ARN.

        • Dimensions (list) –

          Additional key-value pairs that define the candidate, such as the retrieval-augmented generation (RAG) Knowledge Base, RAG prompt template, and RAG number of results. Dimensions are part of the candidate’s identity: two candidates that differ only in their dimensions are distinct candidates. Each key can appear at most once.

          • (dict) –

            A key-value pair that, together with the other fields of the customer model configuration, defines a leaderboard candidate.

            • Key (string) –

              The dimension key.

            • Value (string) –

              The dimension value. The required format depends on the key.

    • EvaluationResults (list) –

      All of the evaluation metrics that were added to the candidate, grouped by evaluation criterion.

      • (dict) –

        The result of evaluating a candidate against one evaluation criterion.

        • CriterionName (string) –

          The name of the evaluation criterion.

        • Metrics (dict) –

          The metric values for the criterion, as a map of metric name to value.

          • (string) –

            • (float) –

        • Producer (string) –

          The source that produced the evaluation result.

        • SourceId (string) –

          The ID that the producer’s system, such as MLflow, assigns to the evaluation run that produced the result. The ID must begin with a letter or number and can contain only letters, numbers, hyphens (-), and underscores (_).

        • SourceUrl (string) –

          A URL where you can view the evaluation run that produced the result. The URL must begin with https://.

        • References (dict) –

          Key-value pairs that link the result to related resources. Keys can contain only Unicode letters, numbers, spaces, and the following characters: _ . : / = + - @. Values can’t contain control characters or format characters.

          • (string) –

            • (string) –

        • RecordedAt (datetime) –

          When the evaluation result was produced. ListCandidates uses this value to find the candidate’s most recent evaluation run.

        • IngestedAt (datetime) –

          When SageMaker added the result to the leaderboard. SageMaker sets this value. If you specify it in AddCandidate, SageMaker ignores it.

    • CreationTime (datetime) –

      When the candidate was added to the leaderboard.

    • LastModifiedTime (datetime) –

      When the candidate was last modified.

Exceptions