class_docstr: Selects instances by constructing a greedy coreset [SS17]_ over document embeddings.
      
class_docstr_tok: ["Selects","instances","by","constructing","a","greedy","coreset","[","SS17","]","_","over","document","embeddings","."]
docstr: Parameters
  ----------
  distance_metric : {'cosine', 'euclidean'}
       Distance metric to be used.
  
       .. versionadded:: 1.2.0
  normalize : bool
      Embeddings will be normalized before the coreset construction if True.
  batch_size : int
      Batch size used for computing document distances.
  
  
  .. note::
  
     The default distance metric before v1.2.0 used to be cosine distance.
  
  .. seealso::
  
     Function :py:func:`.greedy_coreset`
        Docstrings of the underlying :py:func:`greedy_coreset` method.
docstr_tok: ["Parameters","--","--","--","--","--","distance_metric",":","{","'cosine","'",",","'euclidean","'","}","Distance","metric","to","be","used",".","..","versionadded",":",":","1.2.0","normalize",":","bool","Embeddings","will","be","normalized","before","the","coreset","construction","if","True",".","batch_size",":","int","Batch","size","used","for","computing","document","distances",".","..","note",":",":","The","default","distance","metric","before","v1.2.0","used","to","be","cosine","distance",".","..","seealso",":",":","Function",":","py",":","func",":","`",".greedy_coreset","`","Docstrings","of","the","underlying",":","py",":","func",":","`","greedy_coreset","`","method","."]
code: def __init__(
      self, distance_metric="euclidean", normalize=True, batch_size=100
  ):
      """
      Parameters
      ----------
      distance_metric : {'cosine', 'euclidean'}
           Distance metric to be used.
  
           .. versionadded:: 1.2.0
      normalize : bool
          Embeddings will be normalized before the coreset construction if True.
      batch_size : int
          Batch size used for computing document distances.
  
  
      .. note::
  
         The default distance metric before v1.2.0 used to be cosine distance.
  
      .. seealso::
  
         Function :py:func:`.greedy_coreset`
            Docstrings of the underlying :py:func:`greedy_coreset` method.
      """
      if distance_metric not in set(_DISTANCE_METRICS):
          raise ValueError(
              f"Invalid distance metric: {distance_metric}. "
              f"Possible values: {_DISTANCE_METRICS}"
          )
  
      if distance_metric != "cosine":
          warnings.warn(
              'Default distance metric has changed from "cosine" '
              'to "euclidean" in v1.2.0. This warning will disappear in '
              "v2.0.0."
          )
  
      self.distance_metric = distance_metric
      self.normalize = normalize
      self.batch_size = batch_size
  
file_path: small-text/small_text/query_strategies/coresets.py
imports: import warnings
  import numpy
  from sklearn.metrics import pairwise_distances
  from small_text.query_strategies.strategies import EmbeddingBasedQueryStrategy
label_desc: Use image node_id 1 to create a new GreedyCoreset object from inherited base classes: EmbeddingBasedQueryStrategy with example: obj = GreedyCoreset(distance_metric, normalize, batch_size)