Search
K
Links

Regression

How to log your model schema for regression models

Regression Model Overview

Regression models have a continuous, numeric output. (Examples: click-through rates, sales forecasting, customer lifetime value, ETA models, etc.)

Performance Metrics

MAPE, MAE, RMSE, MSE, R-Squared, Mean Error
Allowed Metric Families: Regression
Click here for all valid model types and metric combinations.

Regression Code Example

Python Pandas
Python Single Record
Data Connector

Example Row

price (float)
pos_approved (bool)
zip_code
age
prediction_score
actual_score
prediction_ts
88.5
False
12345
25
100
90
1671572541
# 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_score_column_name="prediction_score",
actual_score_column_name="actual_score",
feature_column_names=["price", "pos_approved"],
tag_column_names=["zip_code", "age"]
)
# Log the dataframe with the schema mapping
response = client.log(
model_id='sample-model-1',
model_version='v1',
model_type=ModelTypes.REGRESSION,
metrics_validation=[Metrics.REGRESSION],
environment=Environments.PRODUCTION,
dataframe=test_dataframe,
schema=schema
)
features = {
'score': '88.5',
'pos_approved': False,
}
tags = {
'zip_code': '12345'
'age': '25'
}
response = client.log(
model_id='sample-model-1',
model_version='v1',
model_type=ModelTypes.REGRESSION,
environment=Environments.PRODUCTION,
features = features,
tags=tags
prediction_label=100,
actual_label=90
)

Quick Definitions

Prediction Label: The numeric value of the prediction (float | int)
Actual Label: The numeric value of the actual (float | int)