# features & tags can be optionally defined with typingfeatures ={'state':'ca','pos_approved':TypedValue(value=True, type=ArizeTypes.INT)}tags ={'zip_code':'12345','age':'25'}response = arize_client.log( model_id='sample-model-1', model_version='v1', model_type=ModelTypes.BINARY_CLASSIFICATION, environment=Environments.PRODUCTION, features=features, tags=tags, prediction_label="not fraud", actual_label="fraud")
For more information on Python Single Record Logging API Reference, visit here:
features ={'state':'ca','pos_approved':True,'item_count':10}# features & tags can be optionally defined with typing tags ={'zip_code':TypedValue(value='12345', type=ArizeTypes.INT),'age':'25'}response = arize_client.log( model_id='sample-model-1', model_version='v1', model_type=ModelTypes.BINARY_CLASSIFICATION, environment=Environments.PRODUCTION, features=features, tags=tags, prediction_label=("not fraud", 0.3), actual_label="fraud")
For more information on Python Single Record Logging API Reference, visit here:
To declareprediction_scoreONLY, pass a tuple of an empty string and your prediction_score through the prediction_label argument.
Code Example
# features & tags can be optionally defined with typingfeatures ={'state':'ca','pos_approved':TypedValue(value=True, type=ArizeTypes.INT)}tags ={'zip_code':'12345','age':'25'}response = arize_client.log( model_id='sample-model-1', model_version='v1', model_type=ModelTypes.BINARY_CLASSIFICATION, environment=Environments.PRODUCTION, features=features, tags=tags, prediction_label=("", 0.3), actual_label="fraud",)
For more information on Python Single Record Logging API Reference, visit here:
For some use cases, it may be important to treat a prediction for which no corresponding actual label has been logged yet as having a default negative class actual label.
For example, consider tracking advertisement conversion rates for an ad clickthrough rate model, where the positive class is click and the negative class is no_click. For ad conversion purposes, a prediction without a correspondingactual label for an ad placement is equivalent to logging an explicit no_click actual label for the prediction. In both cases, the result is the same: a user has not converted by clicking on the ad.
For AUC-ROC, PR-AUC, and Log Loss performance metrics, Arize supports treating predictions without an explicit actual label as having the negative class actual label by default. In the above example, a click prediction without an actual would be treated as a false positive, because the missing actual for the prediction would, by default, be assigned to the no_click negative class.
This feature can be enabled for monitors and dashboards via the model performance config section of your model's config page.
Quick Definitions
Prediction Label: The classification label of this event (Cardinality = 2)
Actual Label: The ground truth label (Cardinality = 2)
Prediction Score: The likelihood of the event (Probability between 0 to 1)