ML Models#
- class MLModelsClient(*, sdk_config: SDKConfiguration)[source]#
Bases:
objectClient for logging ML model predictions and actuals to Arize.
This class is primarily intended for internal use within the SDK. Users are highly encouraged to access resource-specific functionality via
arize.ArizeClient.- Parameters:
sdk_config (SDKConfiguration) – Resolved SDK configuration.
- log_stream(*, space_id: str, model_name: str, model_type: ModelTypes, environment: Environments, model_version: str | None = None, prediction_id: PredictionIDType | None = None, prediction_timestamp: int | None = None, prediction_label: PredictionLabelTypes | None = None, actual_label: ActualLabelTypes | None = None, features: dict[str, str | bool | float | int | list[str] | TypedValue] | None = None, embedding_features: dict[str, Embedding] | None = None, shap_values: dict[str, float] | None = None, tags: dict[str, str | bool | float | int | TypedValue] | None = None, batch_id: str | None = None, prompt: str | Embedding | None = None, response: str | Embedding | None = None, prompt_template: str | None = None, prompt_template_version: str | None = None, llm_model_name: str | None = None, llm_params: dict[str, str | bool | float | int] | None = None, llm_run_metadata: LLMRunMetadata | None = None, timeout: float | None = None) cf.Future[source]#
Log a single model prediction or actual to Arize asynchronously.
This method sends a single prediction, actual, or both to Arize for ML monitoring. The request is made asynchronously and returns a Future that can be used to check the status or retrieve the response.
- Parameters:
space_id (str) – The space ID where the model resides.
model_name (str) – A unique name to identify your model in the Arize platform.
model_type (ModelTypes) – The type of model. Supported types: BINARY, MULTI_CLASS, REGRESSION, RANKING, OBJECT_DETECTION. Note: GENERATIVE_LLM is not supported; use the spans module instead.
environment (Environments) – The environment this data belongs to (PRODUCTION, TRAINING, or VALIDATION).
model_version (str | None) – Optional version identifier for the model.
prediction_id (PredictionIDType | None) – Unique identifier for this prediction. If not provided, one will be auto-generated for PRODUCTION environment.
prediction_timestamp (int | None) – Unix timestamp (seconds) for when the prediction was made. If not provided, the current time is used. Must be within 1 year in the future and 2 years in the past from the current time.
prediction_label (PredictionLabelTypes | None) – The prediction output from your model. Type depends on model_type (e.g., string for categorical, float for numeric).
actual_label (ActualLabelTypes | None) – The ground truth label. Type depends on model_type.
features (dict[str, str | bool | float | int | list[str] | TypedValue] | None) – Dictionary of feature name to feature value. Values can be str, bool, float, int, list[str], or TypedValue.
embedding_features (dict[str, Embedding] | None) – Dictionary of embedding feature name to Embedding object. Maximum 50 embeddings per record. Object detection models support only 1.
shap_values (dict[str, float] | None) – Dictionary of feature name to SHAP value (float) for feature importance/explainability.
tags (dict[str, str | bool | float | int | TypedValue] | None) – Dictionary of metadata tags. Tag names cannot end with “_shap” or be reserved names. Values must be under 1000 characters (warning at 100).
batch_id (str | None) – Required for VALIDATION environment; identifies the validation batch.
prompt (str | Embedding | None) – For generative models, the prompt text or embedding sent to the model.
response (str | Embedding | None) – For generative models, the response text or embedding from the model.
prompt_template (str | None) – Template used to generate the prompt.
prompt_template_version (str | None) – Version identifier for the prompt template.
llm_model_name (str | None) – Name of the LLM model used (e.g., “gpt-4”).
llm_params (dict[str, str | bool | float | int] | None) – Dictionary of LLM configuration parameters (e.g., temperature, max_tokens).
llm_run_metadata (LLMRunMetadata | None) – Metadata about the LLM run including token counts and latency.
timeout (float | None) – Maximum time (in seconds) to wait for the request to complete.
- Returns:
A concurrent.futures.Future object representing the async request. Call .result() to block and retrieve the Response object, or check .done() for completion status.
- Raises:
ValueError – If model_type is GENERATIVE_LLM, or if validation environment is missing batch_id, or if training/validation environment is missing prediction or actual, or if timestamp is out of range, or if no data is provided (must have prediction_label, actual_label, tags, or shap_values), or if tag names end with “_shap” or exceed length limits.
MissingSpaceIDError – If space_id is not provided or empty.
MissingModelNameError – If model_name is not provided or empty.
InvalidValueType – If features, tags, or other parameters have incorrect types.
InvalidNumberOfEmbeddings – If more than 50 embedding features are provided.
KeyError – If tag names include reserved names.
- Return type:
cf.Future
Notes
Timestamps must be within 1 year future and 2 years past from current time
Tag values are truncated at 1000 characters, with warnings at 100 characters
For GENERATIVE_LLM models, use the spans module or OTEL tracing instead
The Future returned can be monitored for request status asynchronously
- log(*, space_id: str, model_name: str, model_type: ModelTypes, dataframe: pd.DataFrame, schema: BaseSchema, environment: Environments, model_version: str = '', batch_id: str = '', validate: bool = True, metrics_validation: list[Metrics] | None = None, surrogate_explainability: bool = False, timeout: float | None = None, tmp_dir: str = '') requests.Response[source]#
Log a batch of model predictions and actuals to Arize from a
pandas.DataFrame.This method uploads multiple records to Arize in a single batch operation using Apache Arrow format for efficient transfer. The dataframe structure is defined by the provided schema which maps dataframe columns to Arize data fields.
- Parameters:
space_id (str) – The space ID where the model resides.
model_name (str) – A unique name to identify your model in the Arize platform.
model_type (ModelTypes) – The type of model. Supported types: BINARY, MULTI_CLASS, REGRESSION, RANKING, OBJECT_DETECTION. Note: GENERATIVE_LLM is not supported; use the spans module instead.
dataframe (
pandas.DataFrame) – Pandas DataFrame containing the data to upload. Columns should correspond to the schema field mappings.schema (BaseSchema) – Schema object (Schema or CorpusSchema) that defines the mapping between dataframe columns and Arize data fields (e.g., prediction_label_column_name, feature_column_names, etc.).
environment (Environments) – The environment this data belongs to (PRODUCTION, TRAINING, VALIDATION, or CORPUS).
model_version (str) – Optional version identifier for the model.
batch_id (str) – Required for VALIDATION environment; identifies the validation batch.
validate (bool) – When True, performs comprehensive validation before sending data. Includes checks for required fields, data types, and value constraints.
metrics_validation (list[Metrics] | None) – Optional list of metric families to validate against.
surrogate_explainability (bool) – When True, automatically generates SHAP values using MIMIC surrogate explainer. Requires the ‘mimic-explainer’ extra. Has no effect if shap_values_column_names is already specified in schema.
timeout (float | None) – Maximum time (in seconds) to wait for the request to complete.
tmp_dir (str) – Optional temporary directory to store serialized Arrow data before upload.
- Returns:
A requests.Response object from the upload request (only returned on HTTP 2xx). Non-2xx responses raise exceptions rather than being returned.
- Raises:
MissingSpaceIDError – If space_id is not provided or empty.
MissingModelNameError – If model_name is not provided or empty.
ValueError – If model_type is GENERATIVE_LLM, or if environment is CORPUS with non-CorpusSchema, or if training/validation records are incomplete.
ValidationFailure – If validate=True and validation checks fail. Contains list of validation error messages.
pa.ArrowInvalid – If the dataframe cannot be converted to Arrow format, typically due to mixed types in columns not specified in the schema.
AuthenticationError – If the server returns HTTP 401 or 403 (invalid API key or space ID). Raised immediately to prevent further uploads with bad credentials.
APIError – If the server returns any other non-2xx response (e.g. 400, 422, 429, 5xx). Raised immediately to prevent further uploads when the server signals an error.
- Return type:
requests.Response
Notes
Categorical dtype columns are automatically converted to string
Extraneous columns not in the schema are removed before upload
Surrogate explainability requires ‘mimic-explainer’ extra
For GENERATIVE_LLM models, use the spans module or OTEL tracing instead
If logging actuals without predictions, ensure predictions were logged first
Data is sent via Apache Arrow for efficient large batch transfers
- export_to_df(*, space_id: str, model_name: str, environment: Environments, start_time: datetime, end_time: datetime, include_actuals: bool = False, model_version: str = '', batch_id: str = '', where: str = '', columns: list | None = None, similarity_search_params: SimilaritySearchParams | None = None, stream_chunk_size: int | None = None) pd.DataFrame[source]#
Export model data from Arize to a
pandas.DataFrame.Retrieves prediction and optional actual data for a model within a specified time range and returns it as a
pandas.DataFramefor analysis.- Parameters:
space_id (str) – The space ID where the model resides.
model_name (str) – The name of the model to export data from.
environment (Environments) – The environment to export from (PRODUCTION, TRAINING, or VALIDATION).
start_time (datetime) – Start of the time range (inclusive) as a datetime object.
end_time (datetime) – End of the time range (inclusive) as a datetime object.
include_actuals (bool) – When True, includes actual labels in the export. When False, only predictions are returned.
model_version (str) – Optional model version to filter by. Empty string returns all versions.
batch_id (str) – Optional batch ID to filter by (for VALIDATION environment).
where (str) – Optional SQL-like WHERE clause to filter rows (e.g., “feature_x > 0.5”).
columns (list | None) – Optional list of column names to include. If None, all columns are returned.
similarity_search_params (SimilaritySearchParams | None) – Optional parameters for embedding similarity search filtering.
stream_chunk_size (int | None) – Optional chunk size for streaming large result sets.
- Returns:
- A pandas DataFrame containing the exported data
with columns for predictions, actuals (if requested), features, tags, timestamps, and other model metadata.
- Return type:
- Raises:
RuntimeError – If the Flight client request fails or returns no response.
Notes
Uses Apache Arrow Flight for efficient data transfer
Large exports may benefit from specifying stream_chunk_size
The where clause supports SQL-like filtering syntax
- export_to_parquet(*, path: str, space_id: str, model_name: str, environment: Environments, start_time: datetime, end_time: datetime, include_actuals: bool = False, model_version: str = '', batch_id: str = '', where: str = '', columns: list | None = None, similarity_search_params: SimilaritySearchParams | None = None, stream_chunk_size: int | None = None) None[source]#
Export model data from Arize to a Parquet file.
Retrieves prediction and optional actual data for a model within a specified time range and writes it directly to a Parquet file at the specified path.
- Parameters:
path (str) – The file path where the Parquet file will be written.
space_id (str) – The space ID where the model resides.
model_name (str) – The name of the model to export data from.
environment (Environments) – The environment to export from (PRODUCTION, TRAINING, or VALIDATION).
start_time (datetime) – Start of the time range (inclusive) as a datetime object.
end_time (datetime) – End of the time range (inclusive) as a datetime object.
include_actuals (bool) – When True, includes actual labels in the export. When False, only predictions are returned.
model_version (str) – Optional model version to filter by. Empty string returns all versions.
batch_id (str) – Optional batch ID to filter by (for VALIDATION environment).
where (str) – Optional SQL-like WHERE clause to filter rows (e.g., “feature_x > 0.5”).
columns (list | None) – Optional list of column names to include. If None, all columns are returned.
similarity_search_params (SimilaritySearchParams | None) – Optional parameters for embedding similarity search filtering.
stream_chunk_size (int | None) – Optional chunk size for streaming large result sets.
- Raises:
RuntimeError – If the Flight client request fails or returns no response.
- Return type:
None
Notes
Uses Apache Arrow Flight for efficient data transfer
Data is written directly to the specified path as a Parquet file
Large exports may benefit from specifying stream_chunk_size
Schema and Column Names#
- class Schema(prediction_id_column_name: str | None = None, feature_column_names: list[str] | TypedColumns | None = None, tag_column_names: list[str] | TypedColumns | None = None, timestamp_column_name: str | None = None, prediction_label_column_name: str | None = None, prediction_score_column_name: str | None = None, actual_label_column_name: str | None = None, actual_score_column_name: str | None = None, shap_values_column_names: dict[str, str] | None = None, embedding_feature_column_names: dict[str, EmbeddingColumnNames] | None = None, prediction_group_id_column_name: str | None = None, rank_column_name: str | None = None, attributions_column_name: str | None = None, relevance_score_column_name: str | None = None, relevance_labels_column_name: str | None = None, object_detection_prediction_column_names: ObjectDetectionColumnNames | None = None, object_detection_actual_column_names: ObjectDetectionColumnNames | None = None, prompt_column_names: str | EmbeddingColumnNames | None = None, response_column_names: str | EmbeddingColumnNames | None = None, prompt_template_column_names: PromptTemplateColumnNames | None = None, llm_config_column_names: LLMConfigColumnNames | None = None, llm_run_metadata_column_names: LLMRunMetadataColumnNames | None = None, retrieved_document_ids_column_name: str | None = None, multi_class_threshold_scores_column_name: str | None = None, semantic_segmentation_prediction_column_names: SemanticSegmentationColumnNames | None = None, semantic_segmentation_actual_column_names: SemanticSegmentationColumnNames | None = None, instance_segmentation_prediction_column_names: InstanceSegmentationPredictionColumnNames | None = None, instance_segmentation_actual_column_names: InstanceSegmentationActualColumnNames | None = None)[source]#
Bases:
BaseSchemaUsed to organize and map column names containing model data within your Pandas dataframe to Arize.
- Parameters:
prediction_id_column_name (str | None) – Column name for the predictions unique identifier. Unique IDs are used to match a prediction to delayed actuals or feature importances in Arize. If prediction ids are not provided, it will default to an empty string “” and, when possible, Arize will create a random prediction id on the server side. Prediction id must be a string column with each row indicating a unique prediction event.
feature_column_names (list[str] | TypedColumns | None) – Column names for features. The content of feature columns can be int, float, string. If TypedColumns is used, the columns will be cast to the provided types prior to logging.
tag_column_names (list[str] | TypedColumns | None) – Column names for tags. The content of tag columns can be int, float, string. If TypedColumns is used, the columns will be cast to the provided types prior to logging.
timestamp_column_name (str | None) – Column name for timestamps. The content of this column must be int Unix Timestamps in seconds.
prediction_label_column_name (str | None) – Column name for categorical prediction values. The content of this column must be convertible to string.
prediction_score_column_name (str | None) – Column name for numeric prediction values. The content of this column must be int/float or list of dictionaries mapping class names to int/float scores in the case of MULTI_CLASS model types.
actual_label_column_name (str | None) – Column name for categorical ground truth values. The content of this column must be convertible to string.
actual_score_column_name (str | None) – Column name for numeric ground truth values. The content of this column must be int/float or list of dictionaries mapping class names to int/float scores in the case of MULTI_CLASS model types.
shap_values_column_names (dict[str, str] | None) – Dictionary mapping feature column name and corresponding SHAP feature importance column name. e.g. {{“feat_A”: “feat_A_shap”, “feat_B”: “feat_B_shap”}}
embedding_feature_column_names (dict[str, EmbeddingColumnNames] | None) – Dictionary mapping embedding display names to EmbeddingColumnNames objects.
prediction_group_id_column_name (str | None) – Column name for ranking groups or lists in ranking models. The content of this column must be string and is limited to 128 characters.
rank_column_name (str | None) – Column name for rank of each element on the its group or list. The content of this column must be integer between 1-100.
relevance_score_column_name (str | None) – Column name for ranking model type numeric ground truth values. The content of this column must be int/float.
relevance_labels_column_name (str | None) – Column name for ranking model type categorical ground truth values. The content of this column must be a string.
object_detection_prediction_column_names (ObjectDetectionColumnNames | None) – ObjectDetectionColumnNames object containing information defining the predicted bounding boxes’ coordinates, categories, and scores.
object_detection_actual_column_names (ObjectDetectionColumnNames | None) – ObjectDetectionColumnNames object containing information defining the actual bounding boxes’ coordinates, categories, and scores.
prompt_column_names (str | EmbeddingColumnNames | None) – column names for text that is passed to the GENERATIVE_LLM model. It accepts a string (if sending only a text column) or EmbeddingColumnNames object containing the embedding vector data (required) and raw text (optional) for the input text your model acts on.
response_column_names (str | EmbeddingColumnNames | None) – column names for text generated by the GENERATIVE_LLM model. It accepts a string (if sending only a text column) or EmbeddingColumnNames object containing the embedding vector data (required) and raw text (optional) for the text your model generates.
prompt_template_column_names (PromptTemplateColumnNames | None) – PromptTemplateColumnNames object containing the prompt template and the prompt template version.
llm_config_column_names (LLMConfigColumnNames | None) – LLMConfigColumnNames object containing the LLM’s model name and its hyper parameters used at inference.
llm_run_metadata_column_names (LLMRunMetadataColumnNames | None) – LLMRunMetadataColumnNames object containing token counts and latency metrics
retrieved_document_ids_column_name (str | None) – Column name for retrieved document ids. The content of this column must be lists with entries convertible to strings.
multi_class_threshold_scores_column_name (str | None) – Column name for dictionary that maps class names to threshold values. The content of this column must be dictionary of str -> int/float.
semantic_segmentation_prediction_column_names (SemanticSegmentationColumnNames | None) – SemanticSegmentationColumnNames object containing information defining the predicted polygon coordinates and categories.
semantic_segmentation_actual_column_names (SemanticSegmentationColumnNames | None) – SemanticSegmentationColumnNames object containing information defining the actual polygon coordinates and categories.
instance_segmentation_prediction_column_names (InstanceSegmentationPredictionColumnNames | None) – InstanceSegmentationPredictionColumnNames object containing information defining the predicted polygon coordinates, categories, scores, and bounding box coordinates.
instance_segmentation_actual_column_names (InstanceSegmentationActualColumnNames | None) – InstanceSegmentationActualColumnNames object containing information defining the actual polygon coordinates, categories, scores, and bounding box coordinates.
attributions_column_name (str | None)
- feature_column_names: list[str] | TypedColumns | None = None#
- tag_column_names: list[str] | TypedColumns | None = None#
- embedding_feature_column_names: dict[str, EmbeddingColumnNames] | None = None#
- object_detection_prediction_column_names: ObjectDetectionColumnNames | None = None#
- object_detection_actual_column_names: ObjectDetectionColumnNames | None = None#
- prompt_column_names: str | EmbeddingColumnNames | None = None#
- response_column_names: str | EmbeddingColumnNames | None = None#
- prompt_template_column_names: PromptTemplateColumnNames | None = None#
- llm_config_column_names: LLMConfigColumnNames | None = None#
- llm_run_metadata_column_names: LLMRunMetadataColumnNames | None = None#
- semantic_segmentation_prediction_column_names: SemanticSegmentationColumnNames | None = None#
- semantic_segmentation_actual_column_names: SemanticSegmentationColumnNames | None = None#
- instance_segmentation_prediction_column_names: InstanceSegmentationPredictionColumnNames | None = None#
- instance_segmentation_actual_column_names: InstanceSegmentationActualColumnNames | None = None#
- get_used_columns_counts() dict[str, int][source]#
Return a dict mapping column names to their usage count.
- has_prediction_columns() bool[source]#
Return True if prediction columns are configured.
- Return type:
- has_feature_importance_columns() bool[source]#
Return True if feature importance columns are configured.
- Return type:
- class TypedColumns(inferred: list[str] | None = None, to_str: list[str] | None = None, to_int: list[str] | None = None, to_float: list[str] | None = None)[source]#
Bases:
objectOptional class used for explicit type enforcement of feature and tag columns in the dataframe.
When initializing a Schema, use TypedColumns in place of a list of string column names:
feature_column_names = TypedColumns( inferred=["feature_1", "feature_2"], to_str=["feature_3"], to_int=["feature_4"], )
Notes
If a TypedColumns object is included in a Schema, pandas version 1.0.0 or higher is required.
Pandas StringDType is still considered an experimental field.
Columns not present in any field will not be captured in the Schema.
StringDType, Int64DType, and Float64DType are all nullable column types. Null values will be ingested and represented in Arize as empty values.
- Parameters:
- class EmbeddingColumnNames(vector_column_name: str = '', data_column_name: str | None = None, link_to_data_column_name: str | None = None)[source]#
Bases:
objectColumn names for embedding feature data.
- Parameters:
- class ObjectDetectionColumnNames(bounding_boxes_coordinates_column_name: str, categories_column_name: str, scores_column_name: str | None = None)[source]#
Bases:
NamedTupleUsed to log object detection prediction and actual values.
These values are assigned to the prediction or actual schema parameter.
- Parameters:
bounding_boxes_coordinates_column_name (str) – Column name containing the coordinates of the rectangular outline that locates an object within an image or video. Pascal VOC format required. The contents of this column must be a List[List[float]].
categories_column_name (str) – Column name containing the predefined classes or labels used by the model to classify the detected objects. The contents of this column must be List[str].
scores_column_names – Column name containing the confidence scores that the model assigns to it’s predictions, indicating how certain the model is that the predicted class is contained within the bounding box. This argument is only applicable for prediction values. The contents of this column must be List[float].
scores_column_name (str | None)
Create new instance of ObjectDetectionColumnNames(bounding_boxes_coordinates_column_name, categories_column_name, scores_column_name)
- class SemanticSegmentationColumnNames(polygon_coordinates_column_name: str, categories_column_name: str)[source]#
Bases:
NamedTupleUsed to log semantic segmentation prediction and actual values.
These values are assigned to the prediction or actual schema parameter.
- Parameters:
polygon_coordinates_column_name (str) – Column name containing the coordinates of the vertices of the polygon mask within an image or video. The first sublist contains the coordinates of the outline of the polygon. The subsequent sublists contain the coordinates of any cutouts within the polygon. The contents of this column must be a List[List[float]].
categories_column_name (str) – Column name containing the predefined classes or labels used by the model to classify the detected objects. The contents of this column must be List[str].
Create new instance of SemanticSegmentationColumnNames(polygon_coordinates_column_name, categories_column_name)
- class InstanceSegmentationPredictionColumnNames(polygon_coordinates_column_name: str, categories_column_name: str, scores_column_name: str | None = None, bounding_boxes_coordinates_column_name: str | None = None)[source]#
Bases:
NamedTupleUsed to log instance segmentation prediction values for the prediction schema parameter.
- Parameters:
polygon_coordinates_column_name (str) – Column name containing the coordinates of the vertices of the polygon mask within an image or video. The first sublist contains the coordinates of the outline of the polygon. The subsequent sublists contain the coordinates of any cutouts within the polygon. The contents of this column must be a List[List[float]].
categories_column_name (str) – Column name containing the predefined classes or labels used by the model to classify the detected objects. The contents of this column must be List[str].
scores_column_name (str | None) – Column name containing the confidence scores that the model assigns to it’s predictions, indicating how certain the model is that the predicted class is contained within the bounding box. This argument is only applicable for prediction values. The contents of this column must be List[float].
bounding_boxes_coordinates_column_name (str | None) – Column name containing the coordinates of the rectangular outline that locates an object within an image or video. Pascal VOC format required. The contents of this column must be a List[List[float]].
Create new instance of InstanceSegmentationPredictionColumnNames(polygon_coordinates_column_name, categories_column_name, scores_column_name, bounding_boxes_coordinates_column_name)
- class InstanceSegmentationActualColumnNames(polygon_coordinates_column_name: str, categories_column_name: str, bounding_boxes_coordinates_column_name: str | None = None)[source]#
Bases:
NamedTupleUsed to log instance segmentation actual values that are assigned to the actual schema parameter.
- Parameters:
polygon_coordinates_column_name (str) – Column name containing the coordinates of the polygon that locates an object within an image or video. The contents of this column must be a List[List[float]].
categories_column_name (str) – Column name containing the predefined classes or labels used by the model to classify the detected objects. The contents of this column must be List[str].
bounding_boxes_coordinates_column_name (str | None) – Column name containing the coordinates of the rectangular outline that locates an object within an image or video. Pascal VOC format required. The contents of this column must be a List[List[float]].
Create new instance of InstanceSegmentationActualColumnNames(polygon_coordinates_column_name, categories_column_name, bounding_boxes_coordinates_column_name)
- class PromptTemplateColumnNames(template_column_name: str | None = None, template_version_column_name: str | None = None)[source]#
Bases:
objectColumn names for prompt template configuration in LLM schemas.
- class LLMConfigColumnNames(model_column_name: str | None = None, params_column_name: str | None = None)[source]#
Bases:
objectColumn names for LLM configuration parameters in schemas.
- class LLMRunMetadataColumnNames(total_token_count_column_name: str | None = None, prompt_token_count_column_name: str | None = None, response_token_count_column_name: str | None = None, response_latency_ms_column_name: str | None = None)[source]#
Bases:
objectColumn names for LLM run metadata fields in schemas.
- Parameters:
Labels and Types#
- class Embedding(vector: list[float], data: str | list[str] | None = None, link_to_data: str | None = None)[source]#
Bases:
NamedTupleContainer for embedding vector data with optional raw data and links.
Create new instance of Embedding(vector, data, link_to_data)
- class LLMRunMetadata(total_token_count: int | None = None, prompt_token_count: int | None = None, response_token_count: int | None = None, response_latency_ms: int | float | None = None)[source]#
Bases:
NamedTupleMetadata for LLM execution including token counts and latency.
Create new instance of LLMRunMetadata(total_token_count, prompt_token_count, response_token_count, response_latency_ms)
- Parameters:
- class ObjectDetectionLabel(bounding_boxes_coordinates: list[list[float]], categories: list[str], scores: list[float] | None = None)[source]#
Bases:
NamedTupleLabel data for object detection tasks with bounding boxes and categories.
Create new instance of ObjectDetectionLabel(bounding_boxes_coordinates, categories, scores)
- Parameters:
- class MultiClassPredictionLabel(prediction_scores: dict[str, float | int], threshold_scores: dict[str, float | int] | None = None)[source]#
Bases:
NamedTupleUsed to log multi class prediction label.
- Parameters:
Create new instance of MultiClassPredictionLabel(prediction_scores, threshold_scores)
- class MultiClassActualLabel(actual_scores: dict[str, float | int])[source]#
Bases:
NamedTupleUsed to log multi class actual label.
- Parameters:
actual_scores (dict[str, float | int]) – The actual scores of the classes. Any class in actual_scores with a score of 1 will be sent to arize.
Create new instance of MultiClassActualLabel(actual_scores,)
- class RankingPredictionLabel(group_id: str, rank: int, score: float | None = None, label: str | None = None)[source]#
Bases:
NamedTuplePrediction label for ranking tasks with group and rank information.
Create new instance of RankingPredictionLabel(group_id, rank, score, label)