add_candidate
¶
add_candidate(
*,
config_overrides: Optional[SageMakerClientConfig] = None,
leaderboard_arn: Optional[LeaderboardArn] = None,
display_name: Optional[LeaderboardCandidateDisplayName] = None,
labels: Optional[LeaderboardLabelMap] = None,
candidate_config: Optional[LeaderboardCandidateConfig] = None,
evaluation_results: Optional[LeaderboardEvaluationResultList] = None,
client_token: Optional[LeaderboardClientToken] = None,
) -> AddCandidateResponse
Adds a candidate and its evaluation metrics to a leaderboard, or adds evaluation metrics to an existing candidate.
The candidate configuration (CandidateConfig) identifies the candidate. SageMaker derives the CandidateId from the configuration, so the same configuration always produces the same CandidateId on a leaderboard. The display name and labels aren't part of the identity.
If a candidate with the same configuration already exists on the leaderboard, AddCandidate updates it as follows:
-
Adds the evaluation metrics in the request to the candidate's existing metrics.
-
Replaces the candidate's labels if you specify
Labels. If you don't specifyLabels, the existing labels are kept. -
Keeps the existing display name.
DisplayNametakes effect only when the candidate is created.
Parameters:
-
leaderboard_arn(Optional[LeaderboardArn], default:None) –The Amazon Resource Name (ARN) of the leaderboard to add the candidate to.
-
display_name(Optional[LeaderboardCandidateDisplayName], default:None) –A display name for the candidate. SageMaker uses this value only when it creates the candidate. If the candidate already exists, SageMaker keeps its existing display name. The display name can't contain control characters or format characters.
-
labels(Optional[LeaderboardLabelMap], default:None) –Key-value pairs that describe the candidate. Labels aren't part of the candidate's identity. If the candidate already exists, these labels replace its existing labels. To remove all labels, specify an empty map. If you don't specify labels, the existing labels are kept. Label keys and values can contain only Unicode letters, numbers, spaces, and the following characters:
_ . : / = + - @. -
candidate_config(Optional[LeaderboardCandidateConfig], default:None) –The configuration that identifies the candidate. Candidates with the same configuration have the same
CandidateId. -
evaluation_results(Optional[LeaderboardEvaluationResultList], default:None) –The evaluation metrics to add to the candidate, grouped by evaluation criterion.
-
client_token(Optional[LeaderboardClientToken], default:None) –A unique, case-sensitive identifier for the request. If you don't specify a client token, the Amazon Web Services SDKs and the Amazon Web Services CLI generate one for you.
Raises:
-
ConflictException–There was a conflict when you attempted to modify a SageMaker entity such as an
ExperimentorArtifact. -
ResourceLimitExceeded–You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.
-
ResourceNotFound–Resource being access is not found.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_sagemaker/_services/sage_maker.py
1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 | |