πŸ“„ Zero Vs Many LabelsΒΆ

operators.balancers.multi_label.zero_vs_many_labels

type: LengthBalancer
fields: 
  - reference_fields/labels
segments_boundaries: 
  - 1
[source]

Explanation about LengthBalancerΒΆ

Balances by a signature that reflects the total length of the fields’ values, quantized into integer segments.

Args:

segments_boundaries (List[int]): distinct integers sorted in increasing order, that maps a given total length into the index of the least of them that exceeds the total length. (If none exceeds – into one index beyond, namely, the length of segments_boundaries)

fields (Optional, List[str])

Example:

when input [{β€œa”: [1, 3], β€œb”: 0, β€œid”: 0}, {β€œa”: [1, 3], β€œb”: 0, β€œid”: 1}, {β€œa”: [], β€œb”: β€œa”, β€œid”: 2}] is fed into

LengthBalancer(fields=["a"], segments_boundaries=[1])

input instances will be counted and balanced against two categories: empty total length (less than 1), and non-empty.

Read more about catalog usage here.