whylogs.core.metrics
#
Submodules#
whylogs.core.metrics.aggregators
whylogs.core.metrics.column_metrics
whylogs.core.metrics.compound_metric
whylogs.core.metrics.condition_count_metric
whylogs.core.metrics.decorators
whylogs.core.metrics.deserializers
whylogs.core.metrics.maths
whylogs.core.metrics.metric_components
whylogs.core.metrics.metrics
whylogs.core.metrics.multimetric
whylogs.core.metrics.serializers
whylogs.core.metrics.unicode_range
Package Contents#
Classes#
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
For string values, maintains a DistributionMetric for the counts of |
|
Generic enumeration. |
- class whylogs.core.metrics.ColumnCountsMetric#
Bases:
whylogs.core.metrics.metrics.Metric
- columnar_update(data: whylogs.core.preprocessing.PreprocessedColumn) whylogs.core.metrics.metrics.OperationResult #
- Parameters
- Return type
- to_summary_dict(cfg: Optional[whylogs.core.configs.SummaryConfig] = None) Dict[str, Any] #
- Parameters
cfg (Optional[whylogs.core.configs.SummaryConfig]) –
- Return type
Dict[str, Any]
- classmethod zero(config: Optional[whylogs.core.metrics.metrics.MetricConfig] = None) ColumnCountsMetric #
- Parameters
config (Optional[whylogs.core.metrics.metrics.MetricConfig]) –
- Return type
- class whylogs.core.metrics.TypeCountersMetric#
Bases:
whylogs.core.metrics.metrics.Metric
- to_summary_dict(cfg: Optional[whylogs.core.configs.SummaryConfig] = None) Dict[str, Any] #
- Parameters
cfg (Optional[whylogs.core.configs.SummaryConfig]) –
- Return type
Dict[str, Any]
- columnar_update(data: whylogs.core.preprocessing.PreprocessedColumn) whylogs.core.metrics.metrics.OperationResult #
- Parameters
- Return type
- classmethod zero(config: Optional[whylogs.core.metrics.metrics.MetricConfig] = None) TypeCountersMetric #
- Parameters
config (Optional[whylogs.core.metrics.metrics.MetricConfig]) –
- Return type
- class whylogs.core.metrics.ConditionCountMetric#
Bases:
whylogs.core.metrics.metrics.Metric
- matches: Dict[str, whylogs.core.metrics.metric_components.IntegralComponent]#
- merge(other: ConditionCountMetric) ConditionCountMetric #
- Parameters
other (ConditionCountMetric) –
- Return type
- columnar_update(data: whylogs.core.preprocessing.PreprocessedColumn) whylogs.core.metrics.metrics.OperationResult #
- Parameters
- Return type
- classmethod zero(config: Optional[whylogs.core.metrics.metrics.MetricConfig] = None) ConditionCountMetric #
- Parameters
config (Optional[whylogs.core.metrics.metrics.MetricConfig]) –
- Return type
- to_protobuf() whylogs.core.proto.MetricMessage #
- Return type
whylogs.core.proto.MetricMessage
- to_summary_dict(cfg: Optional[whylogs.core.configs.SummaryConfig] = None) Dict[str, Any] #
- Parameters
cfg (Optional[whylogs.core.configs.SummaryConfig]) –
- Return type
Dict[str, Any]
- classmethod from_protobuf(msg: whylogs.core.proto.MetricMessage) ConditionCountMetric #
- Parameters
msg (whylogs.core.proto.MetricMessage) –
- Return type
- class whylogs.core.metrics.CardinalityMetric#
Bases:
Metric
Helper class that provides a standard way to create an ABC using inheritance.
- columnar_update(view: whylogs.core.preprocessing.PreprocessedColumn) OperationResult #
- Parameters
- Return type
- to_summary_dict(cfg: Optional[whylogs.core.configs.SummaryConfig] = None) Dict[str, Any] #
- Parameters
cfg (Optional[whylogs.core.configs.SummaryConfig]) –
- Return type
Dict[str, Any]
- classmethod zero(config: Optional[MetricConfig] = None) CardinalityMetric #
- Parameters
config (Optional[MetricConfig]) –
- Return type
- classmethod get_namespace(config: Optional[MetricConfig] = None) str #
- Parameters
config (Optional[MetricConfig]) –
- Return type
- merge(other: METRIC) METRIC #
- Parameters
other (METRIC) –
- Return type
METRIC
- to_protobuf() whylogs.core.proto.MetricMessage #
- Return type
whylogs.core.proto.MetricMessage
- classmethod from_protobuf(msg: whylogs.core.proto.MetricMessage) METRIC #
- Parameters
msg (whylogs.core.proto.MetricMessage) –
- Return type
METRIC
- class whylogs.core.metrics.DistributionMetric#
Bases:
Metric
Helper class that provides a standard way to create an ABC using inheritance.
- property variance: float#
Returns the sample variance of the stream.
https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford’s_online_algorithm
- Return type
- to_summary_dict(cfg: Optional[whylogs.core.configs.SummaryConfig] = None) Dict[str, Union[int, float, str, None]] #
- columnar_update(view: whylogs.core.preprocessing.PreprocessedColumn) OperationResult #
Update the operation
Algorithm: https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm
- Parameters
view (whylogs.core.preprocessing.PreprocessedColumn) – the preprocessed column
- Returns
how many successful operations we had
- Return type
- merge(other: DistributionMetric) DistributionMetric #
- Parameters
other (DistributionMetric) –
- Return type
- classmethod zero(config: Optional[MetricConfig] = None) DistributionMetric #
- Parameters
config (Optional[MetricConfig]) –
- Return type
- classmethod get_namespace(config: Optional[MetricConfig] = None) str #
- Parameters
config (Optional[MetricConfig]) –
- Return type
- to_protobuf() whylogs.core.proto.MetricMessage #
- Return type
whylogs.core.proto.MetricMessage
- classmethod from_protobuf(msg: whylogs.core.proto.MetricMessage) METRIC #
- Parameters
msg (whylogs.core.proto.MetricMessage) –
- Return type
METRIC
- class whylogs.core.metrics.FrequentItemsMetric#
Bases:
Metric
Helper class that provides a standard way to create an ABC using inheritance.
- property strings: List[FrequentItem]#
- Return type
List[FrequentItem]
- frequent_strings: whylogs.core.metrics.metric_components.FrequentStringsComponent#
- columnar_update(view: whylogs.core.preprocessing.PreprocessedColumn) OperationResult #
- Parameters
- Return type
- to_summary_dict(cfg: Optional[whylogs.core.configs.SummaryConfig] = None) Dict[str, Any] #
- Parameters
cfg (Optional[whylogs.core.configs.SummaryConfig]) –
- Return type
Dict[str, Any]
- classmethod zero(config: Optional[MetricConfig] = None) FrequentItemsMetric #
- Parameters
config (Optional[MetricConfig]) –
- Return type
- classmethod get_namespace(config: Optional[MetricConfig] = None) str #
- Parameters
config (Optional[MetricConfig]) –
- Return type
- merge(other: METRIC) METRIC #
- Parameters
other (METRIC) –
- Return type
METRIC
- to_protobuf() whylogs.core.proto.MetricMessage #
- Return type
whylogs.core.proto.MetricMessage
- classmethod from_protobuf(msg: whylogs.core.proto.MetricMessage) METRIC #
- Parameters
msg (whylogs.core.proto.MetricMessage) –
- Return type
METRIC
- class whylogs.core.metrics.IntsMetric#
Bases:
Metric
Helper class that provides a standard way to create an ABC using inheritance.
- columnar_update(data: whylogs.core.preprocessing.PreprocessedColumn) OperationResult #
- Parameters
- Return type
- classmethod zero(config: Optional[MetricConfig] = None) IntsMetric #
- Parameters
config (Optional[MetricConfig]) –
- Return type
- to_summary_dict(cfg: Optional[whylogs.core.configs.SummaryConfig] = None) Dict[str, Union[int, float, str, None]] #
- classmethod get_namespace(config: Optional[MetricConfig] = None) str #
- Parameters
config (Optional[MetricConfig]) –
- Return type
- merge(other: METRIC) METRIC #
- Parameters
other (METRIC) –
- Return type
METRIC
- to_protobuf() whylogs.core.proto.MetricMessage #
- Return type
whylogs.core.proto.MetricMessage
- classmethod from_protobuf(msg: whylogs.core.proto.MetricMessage) METRIC #
- Parameters
msg (whylogs.core.proto.MetricMessage) –
- Return type
METRIC
- class whylogs.core.metrics.Metric#
Bases:
abc.ABC
Helper class that provides a standard way to create an ABC using inheritance.
- classmethod get_namespace(config: Optional[MetricConfig] = None) str #
- Parameters
config (Optional[MetricConfig]) –
- Return type
- merge(other: METRIC) METRIC #
- Parameters
other (METRIC) –
- Return type
METRIC
- to_protobuf() whylogs.core.proto.MetricMessage #
- Return type
whylogs.core.proto.MetricMessage
- abstract to_summary_dict(cfg: Optional[whylogs.core.configs.SummaryConfig] = None) Dict[str, Any] #
- Parameters
cfg (Optional[whylogs.core.configs.SummaryConfig]) –
- Return type
Dict[str, Any]
- abstract columnar_update(data: whylogs.core.preprocessing.PreprocessedColumn) OperationResult #
- Parameters
- Return type
- abstract classmethod zero(config: Optional[MetricConfig] = None) METRIC #
- Parameters
config (Optional[MetricConfig]) –
- Return type
METRIC
- classmethod from_protobuf(msg: whylogs.core.proto.MetricMessage) METRIC #
- Parameters
msg (whylogs.core.proto.MetricMessage) –
- Return type
METRIC
- class whylogs.core.metrics.MetricConfig#
- class whylogs.core.metrics.UnicodeRangeMetric(submetrics: Dict[str, Dict[str, whylogs.core.metrics.Metric]])#
Bases:
whylogs.core.metrics.multimetric.MultiMetric
For string values, maintains a DistributionMetric for the counts of characters that fall within user-defined codepoint ranges.
- Parameters
- range_definitionsDict[str, Tuple[int, int]]
Defines the character ranges to be counted. The key servers as the range name and should only contain alphanumeric, hyphen, and underscore characters. The tuple defines the Unicode codepoint range to be tracked. The string length is tracked under the key “STRING_LENGTH” so don’t use that as a range name.
- Parameters
submetrics (Dict[str, Dict[str, whylogs.core.metrics.Metric]]) –
- submetrics: Dict[str, Dict[str, whylogs.core.metrics.Metric]]#
- merge(other: UnicodeRangeMetric) UnicodeRangeMetric #
- Parameters
other (UnicodeRangeMetric) –
- Return type
- columnar_update(view: whylogs.core.preprocessing.PreprocessedColumn) whylogs.core.metrics.metrics.OperationResult #
- Parameters
- Return type
- classmethod zero(config: Optional[whylogs.core.metrics.metrics.MetricConfig] = None) UnicodeRangeMetric #
- Parameters
config (Optional[whylogs.core.metrics.metrics.MetricConfig]) –
- Return type
- classmethod from_protobuf(msg: whylogs.core.proto.MetricMessage) UnicodeRangeMetric #
- Parameters
msg (whylogs.core.proto.MetricMessage) –
- Return type
- merge_submetrics(other: MULTI_METRIC) Dict[str, Dict[str, whylogs.core.metrics.Metric]] #
- Parameters
other (MULTI_METRIC) –
- Return type
Dict[str, Dict[str, whylogs.core.metrics.Metric]]
- to_protobuf() whylogs.core.proto.MetricMessage #
- Return type
whylogs.core.proto.MetricMessage
- to_summary_dict(cfg: Optional[whylogs.core.configs.SummaryConfig] = None) Dict[str, Any] #
- Parameters
cfg (Optional[whylogs.core.configs.SummaryConfig]) –
- Return type
Dict[str, Any]
- classmethod submetrics_from_protobuf(msg: whylogs.core.proto.MetricMessage) Dict[str, Dict[str, whylogs.core.metrics.Metric]] #
- Parameters
msg (whylogs.core.proto.MetricMessage) –
- Return type
Dict[str, Dict[str, whylogs.core.metrics.Metric]]
- class whylogs.core.metrics.StandardMetric(clz: metrics.Metric)#
Bases:
enum.Enum
Generic enumeration.
Derive from this class to define new enumerations.
- Parameters
clz (metrics.Metric) –
- types#
- distribution#
- counts#
- ints#
- cardinality#
- frequent_items#
- unicode_range#
- condition_count#
- zero(config: Optional[metrics.MetricConfig] = None) metrics.Metric #
- Parameters
config (Optional[metrics.MetricConfig]) –
- Return type
- name()#
The name of the Enum member.
- value()#
The value of the Enum member.