Arize AI
Search…
⌃K

Regression

How to log your model schema for regression models

Regression Model Overview

Regression models have a continuous, numeric output. There are two variants of this model type: regression and time series forecasting.

Performance Metric

MAPE, MAE, RMSE, MSE, R2, Mean Error

Examples

File Type
Regression
Timeseries
Python Batch

Regression Model Schema Parameters

Arize Field
Data Type
Example
str
"prediction_id"
timestamp
str
"prediction_ts"
List[str]
["MERCHANT_TYPE", "ENTRY_MODE", "STATE"]
List[str]
["ZIP_CODE", "GENDER", "AGE"]
model_id
str
'sample-model-1'
str
'v1'
model_type
str
ModelTypes.NUMERIC
str
Environments.PRODUCTION
prediction_label
float | int
100
actual_label
float | int
90

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",
actual_label_column_name="ACTUAL",
feature_column_names=["MERCHANT_TYPE", "ENTRY_MODE", "STATE"],
tag_column_names=["ZIP_CODE", "GENDER", "AGE"]
)
# Log the dataframe with the schema mapping
response = client.log(
model_id='sample-model-1',
model_version='v1',
model_type=ModelTypes.NUMERIC,
environment=Environments.PRODUCTION,
dataframe=test_dataframe,
schema=schema,
prediction_label=100,
actual_label=90,
)
This example is for the python batch ingestion method, for other languages, please refer to our examples.
Examples: click-through rates, sales forecasting, customer lifetime value, ETA models, etc.

Regression Schema

Actual Label

The numeric value that the actual is for regression models

Prediction Label

The numeric value that the prediction is for regression models

Tags

Leverage tags to capture the following metadata:
  • run date: date which the prediction was run on
For the timestamp, you want to use the forecast date (when the prediction is for)