whylogs.core.model_performance_metrics#

Submodules#

Package Contents#

Classes#

ModelPerformanceMetrics

Container class for various model-related performance metrics

class whylogs.core.model_performance_metrics.ModelPerformanceMetrics(confusion_matrix: Optional[whylogs.core.model_performance_metrics.confusion_matrix.ConfusionMatrix] = None, regression_metrics: Optional[whylogs.core.model_performance_metrics.regression_metrics.RegressionMetrics] = None, metrics: Optional[Dict[str, whylogs.core.metrics.metrics.Metric]] = None, field_metadata: Optional[Dict[str, Set[str]]] = None)#

Container class for various model-related performance metrics

Parameters
confusion_matrix#

ConfusionMatrix which keeps it track of counts with NumberTracker

Type

ConfusionMatrix

regression_metrics#

Regression Metrics keeps track of a common regression metrics in case the targets are continous.

Type

RegressionMetrics

property output_fields: Optional[List[str]]#
Return type

Optional[List[str]]

to_protobuf() whylogs.core.proto.v0.ModelProfileMessage#
Return type

whylogs.core.proto.v0.ModelProfileMessage

classmethod from_protobuf(message: whylogs.core.proto.v0.ModelProfileMessage) ModelPerformanceMetrics#
Parameters

message (whylogs.core.proto.v0.ModelProfileMessage) –

Return type

ModelPerformanceMetrics

compute_confusion_matrix(predictions: List[Union[str, int, bool, float]], targets: List[Union[str, int, bool, float]], scores: Optional[List[float]] = None)#

computes the confusion_matrix, if one is already present merges to old one.

Parameters
compute_regression_metrics(predictions: List[Union[float, int]], targets: List[Union[float, int]])#
Parameters
  • predictions (List[Union[float, int]]) –

  • targets (List[Union[float, int]]) –

add_metadata_to_field(column_name: str, categories: Set[str]) None#
Parameters
  • column_name (str) –

  • categories (Set[str]) –

Return type

None

specify_output_fields(column_names: Union[str, Set[str]]) None#
Parameters

column_names (Union[str, Set[str]]) –

Return type

None

merge(other) ModelPerformanceMetrics#
Return type

ModelPerformanceMetrics