in tensorflow_data_validation/statistics/generators/basic_stats_generator.py [0:0]
def __init__(
self, has_weights: bool,
make_quantiles_sketch_fn: Callable[[], sketches.QuantilesSketch]):
# The number of values for this feature that equal 0.
self.num_zeros = 0
# The number of NaN values for this feature. This is computed only for
# FLOAT features.
self.num_nan = 0
# The minimum value among all the values for this feature.
self.min = float('inf')
# The maximum value among all the values for this feature.
self.max = float('-inf')
# The minimum value among all the finite values for this feature.
self.finite_min = float('inf')
# The maximum value among all the finite values for this feature.
self.finite_max = float('-inf')
# Summary of the quantiles for the values in this feature.
self.quantiles_summary = make_quantiles_sketch_fn()
self.has_weights = has_weights
# Accumulator for mean and variance.
self.mean_var_accumulator = variance_util.MeanVarAccumulator()
# Keep track of partial weighted numeric stats.
if has_weights:
# Summary of the weighted quantiles for the values in this feature.
self.weighted_quantiles_summary = make_quantiles_sketch_fn()
# Accumulator for weighted mean and weighted variance.
self.weighted_mean_var_accumulator = (
variance_util.WeightedMeanVarAccumulator())
else:
self.weighted_mean_var_accumulator = None