whylogs.util.stats

Statistical functions used by whylogs

Module Contents

Functions

is_discrete(num_records: int, cardinality: int, p=0.15)

Estimate whether a feature is discrete given the number of records

Attributes

CARDINALITY_SLOP

whylogs.util.stats.CARDINALITY_SLOP = 1
whylogs.util.stats.is_discrete(num_records: int, cardinality: int, p=0.15)

Estimate whether a feature is discrete given the number of records observed and the cardinality (number of unique values)

The default assumption is that features are not discrete.

Parameters
  • num_records (int) – The number of observed records

  • cardinality (int) – Number of unique observed values

Returns

discrete – Whether the feature is discrete

Return type

bool