DiscreteHistogram

class verta.data_types.DiscreteHistogram(buckets, data)

Representation of a discrete histogram.

Parameters:
  • buckets (list of str) – Bucket labels.

  • data (list of int) – Counts for each bucket.

Examples

from verta.data_types import DiscreteHistogram
data = DiscreteHistogram(
    buckets=["yes", "no"],
    data=[10, 20],
)
run.log_attribute("response_histogram", data)
diff(other)

Calculate the difference between other and this value.

Parameters:

other (FloatHistogram) – Value to calculate difference from.

Returns:

float – Cosine distance between the normalized bucket values.