log
Last updated
Last updated
Copyright © 2023 Arize AI, Inc
Arize method to log model data record-by-record.
model_id
str
(Required) A unique name to identify your model in the Arize platform
model_type
(Required*) Declared what model type this prediction/actual is for *(as of v.5.X.X)
environment
(Required*) The environment that this prediction/actual is for (Production, Training, Validation) *(as of v.5.X.X)
model_version
str
(Optional) Used to group together a subset of predictions and actuals for a given model_id. Defaults to no_version
prediction_id
str
(Optional) A unique string to identify a prediction event.
Important: This value matches a prediction to an actual label or feature importance (SHAP) in the Arize platform. If prediction_id
is not provided, Arize will, when possible, create a random prediction id on the server side.
prediction_timestamp
int
(Optional) int
representing Unix epoch time in seconds, set overwrite the timestamp for prediction.
If None
, default to log prediction using the current timestamp.
Important: Future and Historical predictions are supported up to 1 year from current wall clock time.
prediction_label
One of str, bool, int, float, Tuple[str,float]
(Optional) The predicted value for a given model input. *Ingest ranking predictions as a ranking object
actual_label
One of str, bool, kkint, float, Tuple[str,float]
(Optional) The actual or ground truth value for a given model input. Important: This actual will be matched to the prediction with the same prediction_id
as the one in this call even if they were logged in separate log
calls.
*Ingest ranking actuals as a ranking object
features
[dict<str, [str, bool, float, int, List[str], TypedValue]>)]
(Optional) Dictionary containing human readable and debuggable model features.
Keys must be of typestr
. Values must be one of str
, bool
, float
, int
, list of string, TypedValue
.
embedding_features
(Optional) Dictionary containing human readable and debuggable model embedding features. Keys must be str
. Values must be Embedding
object
shap_values
[dict<str, float>]
(Optional) Dictionary containing human readable and debuggable model features keys, along with SHAP feature importance values. Keys must bestr
, Values must befloat
.
tags
[dict<str, [str, bool, float, int, TypedValue]>]
(Optional) Dictionary containing human readable and debuggable meta data that can be added on a prediction ID. This can be used to filter analysis by non-feature data. Keys must bestr
. Values must be one of str
, bool
, float
, int, TypedValue
.
batch_id
str
(Optional) Only applicable to Validation datasets. Used to distinguish different batch of data under the same model_id and model_version.
prompt
(Optional) Embedding object containing the embedding vector (required) and raw text (optional, but recommended) for the input text on which your GENERATIVE_LLM
model acts on.
response
(Optional) Embedding object containing the embedding vector (required) and raw text (optional, but recommended) for the text GENERATIVE_LLM
model generates.
prompt_template
str
(Optional) Template used to construct the prompt passed to a large language model. It can include variables using the double braces notation. Example: Given the context {{context}}, answer the following question {{user_question}}
.
prompt_template_version
str
(Optional) The version of the template used.
llm_model_name
str
(Optional) The name of the llm used. Example: gpt-4
.
llm_params
str
(Optional) Invocation hyperparameters passed to the large language model. Example:
{
"temperature": 0.7,
"stop":[".","?"],
"frequency_penalty":"0.2"
}
llm_run_metadata
(Optional) Run metadata for LLM calls. Example: LLMRunMetadata(
total_token_count=400,
prompt_token_count=300,
response_token_count=100,
response_latency_ms=2000,
)