Arize AI
Search…
Model Schema
Familiarize yourself with model schema for different model types.

Overview

Arize logs model inferences and these inferences have a schema. Depending on the model type, there are slight differences in the model schema.
Regression Model Schema and Examples
Score Model Schema and Examples

Example

In this example, we have a dataframe where each row is a model inference and the columns represent various parts of the model schema - features, predictions, and actuals, etc.
Dataframe with Model Inferences

Code Example

# Declare the schema of the dataframe you're sending (feature columns, predictions, timestamp, actuals)
schema = Schema(
prediction_id_column_name="prediction_id",
timestamp_column_name="prediction_ts",
prediction_label_column_name="PREDICTION",
prediction_score_column_name="PREDICTION_SCORE",
actual_label_column_name="ACTUAL",
actual_score_column_name="ACTUAL_SCORE",
feature_column_names=["MERCHANT_TYPE", "ENTRY_MODE", "STATE", "MEAN_AMOUNT", "STD_AMOUNT", "TX_AMOUNT"],
)
# Log the dataframe with the schema mapping
response = arize_client.log(
model_id="sample-model-1",
model_version= "v1",
model_type=ModelTypes.SCORE_CATEGORICAL,
environment=Environments.PRODUCTION,
dataframe=test_dataframe,
schema=schema,
)
For more information on each of the individual parameters, visit the subsections:
Questions? Email us at [email protected] or Slack us in the #arize-support channel
Copy link
Outline
Overview
Example