class_docstr: HALK walking strategy which removes rare vertices from randomly
  extracted walks, increasing the quality of the generated embeddings while
  memory usage decreases.
  
  Attributes:
      _is_support_remote: True if the walking strategy can be used with a
          remote Knowledge Graph, False Otherwise
          Defaults to True.
      freq_thresholds: The minimum frequency thresholds of a (predicate,
          object) hop to be kept. Beware that the accumulation of several
          freq_thresholds extracts more walks, which is not always desirable.
          Defaults to [0.01].
      kg: The global KG used later on for the worker process.
          Defaults to None.
      max_depth: The maximum depth of one walk.
      max_walks: The maximum number of walks per entity.
          Defaults to None.
      md5_bytes: The number of bytes to keep after hashing objects in
          MD5. Hasher allows to reduce the memory occupied by a long text. If
          md5_bytes is None, no hash is applied.
          Defaults to 8.
      random_state: The random state to use to keep random determinism with
          the walking strategy.
          Defaults to None.
      sampler: The sampling strategy.
          Defaults to UniformSampler.
      with_reverse: True to extracts parents and children hops from an
          entity, creating (max_walks * max_walks) walks of 2 * depth,
          allowing also to centralize this entity in the walks. False
          otherwise.
          Defaults to False.
class_docstr_tok: ["HALK","walking","strategy","which","removes","rare","vertices","from","randomly","extracted","walks",",","increasing","the","quality","of","the","generated","embeddings","while","memory","usage","decreases",".","Attributes",":","_is_support_remote",":","True","if","the","walking","strategy","can","be","used","with","a","remote","Knowledge","Graph",",","False","Otherwise","Defaults","to","True",".","freq_thresholds",":","The","minimum","frequency","thresholds","of","a","(","predicate",",","object",")","hop","to","be","kept",".","Beware","that","the","accumulation","of","several","freq_thresholds","extracts","more","walks",",","which","is","not","always","desirable",".","Defaults","to","[","0.01","]",".","kg",":","The","global","KG","used","later","on","for","the","worker","process",".","Defaults","to","None",".","max_depth",":","The","maximum","depth","of","one","walk",".","max_walks",":","The","maximum","number","of","walks","per","entity",".","Defaults","to","None",".","md5_bytes",":","The","number","of","bytes","to","keep","after","hashing","objects","in","MD5",".","Hasher","allows","to","reduce","the","memory","occupied","by","a","long","text",".","If","md5_bytes","is","None",",","no","hash","is","applied",".","Defaults","to","8.","random_state",":","The","random","state","to","use","to","keep","random","determinism","with","the","walking","strategy",".","Defaults","to","None",".","sampler",":","The","sampling","strategy",".","Defaults","to","UniformSampler",".","with_reverse",":","True","to","extracts","parents","and","children","hops","from","an","entity",",","creating","(","max_walks","*","max_walks",")","walks","of","2","*","depth",",","allowing","also","to","centralize","this","entity","in","the","walks",".","False","otherwise",".","Defaults","to","False","."]
docstr: Gets vertices which doesn't reach a certain threshold of frequency
  of occurrence.
  
  Args:
      vertex_to_windices: The dictionary of predicates mapped with the
          walk(s) identifiers to which it appears.
      walks: The walks.
      freq_threshold: The threshold frequency of occurrence.
  
  Returns:
      the infrequent vertices.
docstr_tok: ["Gets","vertices","which","does","n't","reach","a","certain","threshold","of","frequency","of","occurrence",".","Args",":","vertex_to_windices",":","The","dictionary","of","predicates","mapped","with","the","walk","(","s",")","identifiers","to","which","it","appears",".","walks",":","The","walks",".","freq_threshold",":","The","threshold","frequency","of","occurrence",".","Returns",":","the","infrequent","vertices","."]
code: def get_rare_predicates(
      self,
      vertex_to_windices: DefaultDict[str, Set[int]],
      walks: List[SWalk],
      freq_threshold: float,
  ) -> Set[str]:
      """Gets vertices which doesn't reach a certain threshold of frequency
      of occurrence.
  
      Args:
          vertex_to_windices: The dictionary of predicates mapped with the
              walk(s) identifiers to which it appears.
          walks: The walks.
          freq_threshold: The threshold frequency of occurrence.
  
      Returns:
          the infrequent vertices.
  
      """
      rare_vertices = set()
      for vertex in vertex_to_windices:
          if (
              len(vertex_to_windices[vertex]) / len(walks)
              < freq_threshold
          ):
              rare_vertices.add(vertex)
      return rare_vertices
  
file_path: pyRDF2Vec/pyrdf2vec/walkers/halk.py
imports: import itertools
  import math
  from collections import defaultdict
  from typing import DefaultDict, List, Set
  import attr
  from pyrdf2vec.graphs import KG, Vertex
  from pyrdf2vec.typings import EntityWalks, SWalk
  from pyrdf2vec.walkers import RandomWalker
label_desc: Use image node_id 2 for calling the HALKWalker obj's underlying member method code with example usage: obj.get_rare_predicates(vertex_to_windices, walks, freq_threshold) and returns: rare_vertices