class_docstr: .. versionadded:: 1.2.0
docstr: Embeds each sample in the given `data_set`.
  
  The embedding is created by using the underlying sentence transformer model.
  
  Parameters
  ----------
  return_proba : bool
      Also return the class probabilities for `data_set`.
  pbar : 'tqdm' or None, default='tqdm'
      Displays a progress bar if 'tqdm' is passed.
  
  Returns
  -------
  embeddings : np.ndarray
      Embeddings in the shape (N, hidden_layer_dimensionality).
  proba : np.ndarray
      Class probabilities for `data_set` (only if `return_predictions` is `True`).
docstr_tok: ["Embeds","each","sample","in","the","given","`","data_set","`",".","The","embedding","is","created","by","using","the","underlying","sentence","transformer","model",".","Parameters","--","--","--","--","--","return_proba",":","bool","Also","return","the","class","probabilities","for","`","data_set","`",".","pbar",":","'tqdm","'","or","None",",","default='tqdm'","Displays","a","progress","bar","if","'tqdm","'","is","passed",".","Returns","--","--","--","-","embeddings",":","np.ndarray","Embeddings","in","the","shape","(","N",",","hidden_layer_dimensionality",")",".","proba",":","np.ndarray","Class","probabilities","for","`","data_set","`","(","only","if","`","return_predictions","`","is","`","True","`",")","."]
code: def embed(self, data_set, return_proba=False, pbar="tqdm"):
      """Embeds each sample in the given `data_set`.
  
      The embedding is created by using the underlying sentence transformer model.
  
      Parameters
      ----------
      return_proba : bool
          Also return the class probabilities for `data_set`.
      pbar : 'tqdm' or None, default='tqdm'
          Displays a progress bar if 'tqdm' is passed.
  
      Returns
      -------
      embeddings : np.ndarray
          Embeddings in the shape (N, hidden_layer_dimensionality).
      proba : np.ndarray
          Class probabilities for `data_set` (only if `return_predictions` is `True`).
      """
  
      if self.use_differentiable_head is False:
          try:
              check_is_fitted(self.model.model_head)
          except NotFittedError:
              raise ValueError(
                  "Model is not trained. Please call fit() first."
              )
  
      data_set = _truncate_texts(
          self.model, self.max_seq_len, data_set
      )[0]
  
      embeddings = []
      predictions = []
  
      num_batches = int(np.ceil(len(data_set) / self.mini_batch_size))
      with build_pbar_context(
          pbar, tqdm_kwargs={"total": len(data_set)}
      ) as pbar:
          for batch in np.array_split(data_set.x, num_batches, axis=0):
              batch_embeddings, probas = self._create_embeddings(batch)
              pbar.update(batch_embeddings.shape[0])
              embeddings.extend(batch_embeddings.tolist())
              if return_proba:
                  predictions.extend(probas.tolist())
  
      if return_proba:
          return np.array(embeddings), np.array(predictions)
  
      return np.array(embeddings)
  
imports: import types
  import numpy
  from sklearn.exceptions import NotFittedError
  from sklearn.utils.validation import check_is_fitted
  from small_text.base import check_optional_dependency
  from small_text.classifiers.classification import Classifier, EmbeddingMixin
  from small_text.exceptions import UnsupportedOperationException
  from small_text.utils.classification import empty_result, _multi_label_list_to_multi_hot, prediction_result
  from small_text.utils.context import build_pbar_context
  from small_text.utils.labels import csr_to_list
  from small_text.integrations.transformers.classifiers.base import ModelLoadingStrategy
label_desc: Use image node_id 1 for calling the SetFitClassificationEmbeddingMixin obj's underlying member method code with example usage: obj.embed(data_set, return_proba, pbar) and returns: np, np,  np