class_docstr: Selects instances by constructing a lightweight coreset [BLK18]_ over document embeddings.
      
class_docstr_tok: ["Selects","instances","by","constructing","a","lightweight","coreset","[","BLK18","]","_","over","document","embeddings","."]
code: def sample(
      self,
      clf,
      dataset,
      indices_unlabeled,
      _indices_labeled,
      _y,
      n,
      embeddings,
      embeddings_proba=None,
  ):
      embeddings = embeddings[indices_unlabeled]
  
      embeddings_mean = np.mean(embeddings, axis=0)
      if self.normalize:
          from sklearn.preprocessing import normalize
  
          embeddings = normalize(embeddings)
          embeddings_mean = normalize(embeddings_mean[np.newaxis, :])
  
      embeddings_mean = embeddings_mean.ravel()
  
      return lightweight_coreset(
          embeddings, embeddings_mean, n, normalized=self.normalize
      )
  
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 2 for calling the LightweightCoreset obj's underlying member method code with example usage: obj.sample(clf, dataset, indices_unlabeled, _indices_labeled, _y, n, embeddings, embeddings_proba) and returns: lightweight_coreset