code: def class_stats(y: pd.Series) -> List[Tuple[str, str, float, bool]]:
      """Compute classification label statistics.
  
      Args:
          y (pd.Series): Labels.
  
      Returns:
          List[Tuple[str, str, float, bool]]: Tuples of form: (name, description, value, is_lower_better).
      """
      labels = y.values
      labels_unique = np.unique(labels, return_counts=True)
      labels_min_cnt = np.min(labels_unique[1])
      labels_max_cnt = np.max(labels_unique[1])
  
      return [
          (
              "class_normalized_entropy",
              "Normalized entropy of classes.",
              float(entropy(labels, normalized=True)),
              False,
          ),
          (
              "num_classes",
              "Number of distinct classes.",
              float(len(labels_unique)),
              True,
          ),
          (
              "min_class_count",
              "Minimum class count.",
              float(labels_min_cnt),
              False,
          ),
          (
              "max_class_count",
              "Maximum class count.",
              float(labels_max_cnt),
              False,
          ),
          (
              "avg_class_count",
              "Average class count.",
              float(np.average(labels_unique[1])),
              False,
          ),
      ]
  
file_path: interpret/python/powerlift/src/powerlift/measures/task_measures.py
imports: from math import log, e
  from numbers import Number
  from typing import Iterable, List, Tuple
  import numpy
  import pandas
label_desc: Use image node_id 2 for calling a global function with example usage: class_stats(y) and returns: list