Custom scoring metrics¶
CustomScoringMetric¶
A versioned custom scoring metric container.
Variables
| Attribute | Type | Description |
|---|---|---|
id |
str |
Unique identifier. |
name |
str |
Display name of the metric. |
target_type |
str |
The target type this metric applies to (e.g. Binary, Regression, Multiclass). |
user_id |
str or None |
ID of the user who created the metric. |
organization_id |
str or None |
ID of the owning organization. |
description |
str or None |
Optional description. |
latest_version_num |
int |
The highest version number that has been created. |
is_archived |
bool |
Whether the metric has been soft-deleted. |
created_at |
str or None |
ISO-8601 creation timestamp. |
updated_at |
str or None |
ISO-8601 last-updated timestamp. |
tags |
list of dict |
Tag entries, each {"name": str, "value": str} (additional keys allowed). |
list()¶
List custom scoring metrics.
Parameters
| Parameter | Type | Description |
|---|---|---|
offset |
int |
Number of records to skip. |
limit |
int |
Maximum number of records to return. |
target_type |
str, optional |
Filter by target type (e.g. “Binary”, “Regression”, “Multiclass”). |
search |
str, optional |
Filter by name sub-string. |
is_archived |
bool |
When True, return only archived metrics. When False (default), non-archived metrics are returned and isArchived is omitted from the list request. |
tags |
list of dict, optional |
Tag entries shaped as {"name": ..., "value": ...}. |
Return type: list[CustomScoringMetric]
create()¶
Create a new custom scoring metric container.
Parameters
| Parameter | Type | Description |
|---|---|---|
name |
str |
Display name for the metric. |
target_type |
str |
Target type this metric applies to. |
description |
str, optional |
Optional description. |
tags |
list of dict, optional |
Tag entries shaped as {"name": ..., "value": ...}. |
Return type: CustomScoringMetric
get()¶
Retrieve a custom scoring metric by ID.
Parameters
| Parameter | Type | Description |
|---|---|---|
metric_id |
str |
The ID of the metric to retrieve. |
Return type: CustomScoringMetric
update()¶
Update the name, description, or tags of this metric.
Parameters
| Parameter | Type | Description |
|---|---|---|
name |
str, optional |
New display name. |
description |
str, optional |
New description. |
tags |
list of dict, optional |
Replacement tags, each {"name": ..., "value": ...}. |
Returns
| Returns | Description |
|---|---|
| This instance, updated in place. |
Return type: CustomScoringMetric
CustomScoringMetricVersion¶
A single version of a custom scoring metric.
Versions are created by uploading a metadata.yml and custom_metrics.py
file pair. Each new version receives the next sequential version number.
Variables
| Attribute | Type | Description |
|---|---|---|
id |
str |
Unique identifier of this version. |
custom_scoring_metric_registry_id |
str |
ID of the parent metric container. |
version_num |
int or None |
Sequential version number assigned on creation. |
files_catalog_id |
str or None |
ID of the files catalog entry storing the uploaded files. |
files_catalog_version_id |
str or None |
ID of the specific catalog version. |
metrics |
list |
Metric definitions parsed from the uploaded metadata. |
stage |
str or None |
Lifecycle stage of this version. |
description |
str or None |
Optional description provided at upload time. |
validation_status |
str or None |
Status of server-side validation of the uploaded files. |
user_id |
str or None |
ID of the user who created this version. |
list()¶
List all versions for a given custom scoring metric.
Parameters
| Parameter | Type | Description |
|---|---|---|
metric_id |
str |
ID of the parent metric container. |
offset |
int |
Number of records to skip. |
limit |
int |
Maximum number of records to return. |
Return type: list[CustomScoringMetricVersion]
create()¶
Upload a new version of a custom scoring metric.
Sends metadata.yml and custom_metrics.py as multipart form data.
Parameters
| Parameter | Type | Description |
|---|---|---|
metric_id |
str |
ID of the parent metric container. |
metadata_file_path |
str |
Local path to the metadata.yml file. |
code_file_path |
str |
Local path to the custom_metrics.py file. |
description |
str, optional |
Optional description for this version. |
Return type: CustomScoringMetricVersion
get()¶
Retrieve a specific version of a custom scoring metric.
Parameters
| Parameter | Type | Description |
|---|---|---|
metric_id |
str |
ID of the parent metric container. |
version_id |
str |
ID of the version to retrieve. |
Return type: CustomScoringMetricVersion
get_file_contents()¶
Retrieve the raw metadata and code file contents for a version.
Parameters
| Parameter | Type | Description |
|---|---|---|
registry_id |
str |
ID of the parent custom scoring metric registry. |
registry_version_id |
str |
ID of the registry version whose files should be retrieved. |
Return type: CustomScoringMetricVersionFileContents
get_files()¶
Retrieve the raw metadata and code file contents for this version.
Return type: CustomScoringMetricVersionFileContents
CustomScoringMetricVersionFileContents¶
Raw file contents (metadata + code) backing a custom scoring metric version.
Variables
| Attribute | Type | Description |
|---|---|---|
metadata_file_name |
str |
Stored name of the metadata file (e.g. metadata.yml or metadata.yaml). |
metadata_file_contents |
str |
Raw UTF-8 contents of the metadata file. |
code_file_name |
str |
Stored name of the Python file (e.g. custom_metrics.py). |
code_file_contents |
str |
Raw UTF-8 contents of the custom metrics Python file. |