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

1
# Declare the schema of the dataframe you're sending (feature columns, predictions, timestamp, actuals)
2
schema = Schema(
3
prediction_id_column_name="prediction_id",
4
timestamp_column_name="prediction_ts",
5
prediction_label_column_name="PREDICTION",
6
prediction_score_column_name="PREDICTION_SCORE",
7
actual_label_column_name="ACTUAL",
8
actual_score_column_name="ACTUAL_SCORE",
9
feature_column_names=["MERCHANT_TYPE", "ENTRY_MODE", "STATE", "MEAN_AMOUNT", "STD_AMOUNT", "TX_AMOUNT"],
10
)
11
12
# Log the dataframe with the schema mapping
13
response = arize_client.log(
14
model_id="sample-model-1",
15
model_version= "v1",
16
model_type=ModelTypes.SCORE_CATEGORICAL,
17
environment=Environments.PRODUCTION,
18
dataframe=test_dataframe,
19
schema=schema,
20
)
Copied!
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