class_docstr: A ptransform that computes top-k and uniques for string features.
class_docstr_tok: ["A","ptransform","that","computes","top-k","and","uniques","for","string","features","."]
docstr: Initializes _ComputeTopKUniquesStats.
  
  Args:
    schema: An schema for the dataset. None if no schema is available.
    example_weight_map: an ExampleWeightMap that maps a FeaturePath to its
        corresponding weight column.
    num_top_values: The number of most frequent feature values to keep for
        string features.
    frequency_threshold: The minimum number of examples the most frequent
        values must be present in.
    weighted_frequency_threshold: The minimum weighted number of examples the
        most frequent weighted values must be present in.
    num_rank_histogram_buckets: The number of buckets in the rank histogram
        for string features.
docstr_tok: ["Initializes","_ComputeTopKUniquesStats",".","Args",":","schema",":","An","schema","for","the","dataset",".","None","if","no","schema","is","available",".","example_weight_map",":","an","ExampleWeightMap","that","maps","a","FeaturePath","to","its","corresponding","weight","column",".","num_top_values",":","The","number","of","most","frequent","feature","values","to","keep","for","string","features",".","frequency_threshold",":","The","minimum","number","of","examples","the","most","frequent","values","must","be","present","in",".","weighted_frequency_threshold",":","The","minimum","weighted","number","of","examples","the","most","frequent","weighted","values","must","be","present","in",".","num_rank_histogram_buckets",":","The","number","of","buckets","in","the","rank","histogram","for","string","features","."]
code: def __init__(
      self,
      schema: schema_pb2.Schema,
      example_weight_map: ExampleWeightMap,
      num_top_values: int,
      frequency_threshold: int,
      weighted_frequency_threshold: float,
      num_rank_histogram_buckets: int,
  ):
      """Initializes _ComputeTopKUniquesStats.
  
      Args:
        schema: An schema for the dataset. None if no schema is available.
        example_weight_map: an ExampleWeightMap that maps a FeaturePath to its
            corresponding weight column.
        num_top_values: The number of most frequent feature values to keep for
            string features.
        frequency_threshold: The minimum number of examples the most frequent
            values must be present in.
        weighted_frequency_threshold: The minimum weighted number of examples the
            most frequent weighted values must be present in.
        num_rank_histogram_buckets: The number of buckets in the rank histogram
            for string features.
      """
      self._bytes_features = frozenset(
          schema_util.get_bytes_features(schema) if schema else []
      )
      self._categorical_numeric_types = (
          schema_util.get_categorical_numeric_feature_types(schema)
          if schema
          else {}
      )
      self._example_weight_map = example_weight_map
      self._num_top_values = num_top_values
      self._frequency_threshold = frequency_threshold
      self._weighted_frequency_threshold = weighted_frequency_threshold
      self._num_rank_histogram_buckets = num_rank_histogram_buckets
  
imports: import logging
  from typing import Any, FrozenSet, Iterable, Iterator, Mapping, Optional, Text, Tuple, Union
  import apache_beam
  import numpy
  import pandas
  import pyarrow
  from tensorflow_data_validation import types
  from tensorflow_data_validation.arrow import arrow_util
  from tensorflow_data_validation.statistics.generators import stats_generator
  from tensorflow_data_validation.utils import schema_util
  from tensorflow_data_validation.utils import stats_util
  from tensorflow_data_validation.utils import top_k_uniques_stats_util
  from tensorflow_data_validation.utils.example_weight_map import ExampleWeightMap
  from tfx_bsl.arrow import array_util
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 1 to create a new _ComputeTopKUniquesStats object from inherited base classes: beam with example: obj = _ComputeTopKUniquesStats(schema, example_weight_map, num_top_values, frequency_threshold, weighted_frequency_threshold, num_rank_histogram_buckets)