whylogs.core.model_profile

Module Contents

Classes

ModelProfile

Model Class for sketch metrics for model outputs

Attributes

SUPPORTED_TYPES

whylogs.core.model_profile.SUPPORTED_TYPES = ['binary', 'multiclass']
class whylogs.core.model_profile.ModelProfile(output_fields=None, metrics: whylogs.core.metrics.model_metrics.ModelMetrics = None)

Model Class for sketch metrics for model outputs

metrics

the model metrics object

Type

ModelMetrics

model_type

Type of mode, CLASSIFICATION, REGRESSION, UNKNOWN, etc.

Type

ModelType

output_fields

list of fields that map to model outputs

Type

list

add_output_field(self, field: str)
compute_metrics(self, targets, predictions, scores=None, model_type: whylogs.proto.ModelType = None, target_field=None, prediction_field=None, score_field=None)

Compute and track metrics for confusion_matrix

Parameters
  • targets (List) – targets (or actuals) for validation, if these are floats it is assumed the model is a regression type model

  • predictions (List) – predictions (or inferred values)

  • scores (List, optional) – associated scores for each prediction (for binary and multiclass problems)

  • target_field (str, optional) –

  • prediction_field (str, optional) –

  • score_field (str, optional (for binary and multiclass problems)) –

Raises

NotImplementedError

to_protobuf(self)
classmethod from_protobuf(cls, message: whylogs.proto.ModelProfileMessage)
merge(self, model_profile)