module aixplain.factories.metric_factory
class MetricFactory
A static class for creating and exploring Metric Objects.
Attributes:
backend_url
(str): The URL for the backend.
classmethod get
get(metric_id: str) → Metric
Create a 'Metric' object from metric id
Args:
model_id
(Text): Model ID of required metric.
Returns:
Metric
: Created 'Metric' object
classmethod list
list(
model_id: str = None,
is_source_required: Optional[bool] = None,
is_reference_required: Optional[bool] = None,
page_number: int = 0,
page_size: int = 20
) → List[Metric]
Get list of supported metrics for the given filters
Args:
model_id
(Text, optional): ID of model for which metric is to be used. Defaults to None.is_source_required
(bool, optional): Should the metric use source. Defaults to None.is_reference_required
(bool, optional): Should the metric use reference. Defaults to None.page_number
(int, optional): page number. Defaults to 0.page_size
(int, optional): page size. Defaults to 20.
Returns:
List[Metric]
: List of supported metrics