Single Record Logging
Multi class
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
class MultiClassPredictionLabel(
prediction_scores: Dict[str, Union[float, int]] #required
threshold_scores: Dict[str, Union[float, int]] = None # optional but required for multi-label use cases
)
| Argument | Data Type | Definitions |
|---|---|---|
prediction_scores | Dict[str, Union[Float, int]] | (Required) The prediction scores of the classes |
threshold_scores | Dict[str, Union[Float, int]] | (Optional) The threshold scores of the classes. Required for Multi-Label use cases. |
class MultiClassActualLabel(
actual_scores: Dict[str, Union[float, int]]
)
| Argument | Data Type | Definitions |
|---|---|---|
actual_scores | Dict[str, Union[Float, int]] | (Required) The actual scores of the classes. Any class in actual_scores with a score of 1 will be sent to Arize. |
pred_label = MultiClassPredictionLabel(
prediction_scores=record["prediction_scores"],
threshold_scores=record["threshold_scores"], #additional parameter for multi-label use cases
)
actual_label = MultiClassActualLabel(
actual_scores={record["actual_class"]: 1},
)
response = arize_client.log(
model_id="multiclass-classification-multi-label-single-record-ingestion-tutorial",
model_version="1.0",
model_type=ModelTypes.MULTI_CLASS,
environment=Environments.PRODUCTION,
prediction_id=record["prediction_id"],
prediction_label=pred_label,
actual_label=actual_label,
features=record["features"]
)
Was this page helpful?
Suggestions