code: def test_prunning_vocabulary():
      """
      Vocabulary prunning is available to improve accuracy and limit memory usage.
      You can perform vocabulary prunning with parameters vocab_prune_interval (int) and
      maximum_size_vocabulary (int).
      """
  
      lda = preprocessing.LDA(
          n_components=2,
          number_of_documents=60,
          vocab_prune_interval=2,
          maximum_size_vocabulary=3,
          seed=42,
      )
  
      components_list = []
  
      for document in DOC_SET:
          tokens = {token: 1 for token in document.split(" ")}
          components_list.append(lda.learn_transform_one(tokens))
  
      for index, component in enumerate(components_list):
          assert np.array_equal(
              a1=list(component.values()),
              a2=REFERENCE_COMPONENTS_WITH_PRUNNING[index],
          )
  
file_path: river/river/preprocessing/test_lda.py
imports: from __future__ import annotations
  import numpy
  from river import preprocessing
label_desc: Use image node_id 5 for calling a global function with example usage: test_prunning_vocabulary() without return types