Arize AI
Search…
⌃K

Binary Classification Complete

How to log your model schema for binary classification models with all scores and labels

Binary Classification Complete Model Overview

Classification models have a discrete classification label. This overviews a binary classification model with all scores and labels.

Performance Metric

Accuracy, Recall, Precision, FPR, FNR, F1, Sensitivity, Specificity, MAPE, MAE, RMSE, MSE, R2, Mean Error, AUC, PR-AUC, Log Loss

Binary Classification Complete 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.SCORE_CATEGORICAL
str
Environments.PRODUCTION
str | bool
"not fraud"
float
0.3
str | bool
"fraud"
float
0.6

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"],
tag_column_names=["ZIP_CODE", "GENDER", "AGE"]
)
# 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,
prediction_label="not fraud",
prediction_score=0.3,
actual_label="fraud",
actual_score=0.6
)
This example is for the python batch ingestion method, for other languages, please refer to our examples.