code: def _make_categorical_float(
      rng,
      n_samples,
      n_categories,
      categorical_floor,
      categorical_digits,
  ):
      n_modulo = 10**categorical_digits
      n_categories = min(n_categories, n_modulo - 1)
      mapping = rng.permutation(n_categories)
      mapping += n_modulo + 1
      mapping = mapping.astype(str)
      mapping = np.char.add(mapping, ".")
  
      # reserve 0 for an alternative missing representation
      categories = np.arange(1, n_categories + 1).astype(str)
      categories = np.char.zfill(categories, categorical_digits)
  
      mapping = np.char.add(mapping, categories)
      mapping = mapping.astype(float)
  
      probs = rng.permutation(n_categories).astype(float)
      probs *= 1.0 / float(n_categories)
      probs += categorical_floor
      probs *= 1.0 / probs.sum()
  
      vals = rng.choice(n_categories, n_samples, p=probs)
      return mapping[vals]
  
file_path: interpret/python/interpret-core/interpret/utils/_synthetic.py
imports: import numpy
  from itertools import takewhile
  import operator
label_desc: Use image node_id 3 for calling a global function with example usage: _make_categorical_float(rng, n_samples, n_categories, categorical_floor, categorical_digits) and returns: mapping