class_docstr: Compute the affinities between samples.
  
  t-SNE takes as input an affinity matrix :math:`P`, and does not really care
  about anything else from the data. This means we can use t-SNE for any data
  where we are able to express interactions between samples with an affinity
  matrix.
  
  Attributes
  ----------
  P: array_like
      The :math:`N \times N` affinity matrix expressing interactions between
      :math:`N` initial data samples.
  
  verbose: bool
class_docstr_tok: ["Compute","the","affinities","between","samples",".","t-SNE","takes","as","input","an","affinity","matrix",":","math",":","`","P","`",",","and","does","not","really","care","about","anything","else","from","the","data",".","This","means","we","can","use","t-SNE","for","any","data","where","we","are","able","to","express","interactions","between","samples","with","an","affinity","matrix",".","Attributes","--","--","--","--","--","P",":","array_like","The",":","math",":","`","N","\\times","N","`","affinity","matrix","expressing","interactions","between",":","math",":","`","N","`","initial","data","samples",".","verbose",":","bool"]
docstr: Compute the affinities of new samples to the initial samples.
  
  This is necessary for embedding new data points into an existing
  embedding.
  
  Parameters
  ----------
  data: np.ndarray
      The data points to be added to the existing embedding.
  
  return_distances: bool
      If needed, the function can return the indices of the nearest
      neighbors and their corresponding distances.
  
  Returns
  -------
  P: array_like
      An :math:`N \times M` affinity matrix expressing interactions
      between :math:`N` new data points the initial :math:`M` data
      samples.
  
  indices: np.ndarray
      Returned if ``return_distances=True``. The indices of the :math:`k`
      nearest neighbors in the existing embedding for every new data
      point.
  
  distances: np.ndarray
      Returned if ``return_distances=True``. The distances to the
      :math:`k` nearest neighbors in the existing embedding for every new
      data point.
docstr_tok: ["Compute","the","affinities","of","new","samples","to","the","initial","samples",".","This","is","necessary","for","embedding","new","data","points","into","an","existing","embedding",".","Parameters","--","--","--","--","--","data",":","np.ndarray","The","data","points","to","be","added","to","the","existing","embedding",".","return_distances",":","bool","If","needed",",","the","function","can","return","the","indices","of","the","nearest","neighbors","and","their","corresponding","distances",".","Returns","--","--","--","-","P",":","array_like","An",":","math",":","`","N","\\times","M","`","affinity","matrix","expressing","interactions","between",":","math",":","`","N","`","new","data","points","the","initial",":","math",":","`","M","`","data","samples",".","indices",":","np.ndarray","Returned","if","``","return_distances=True","``",".","The","indices","of","the",":","math",":","`","k","`","nearest","neighbors","in","the","existing","embedding","for","every","new","data","point",".","distances",":","np.ndarray","Returned","if","``","return_distances=True","``",".","The","distances","to","the",":","math",":","`","k","`","nearest","neighbors","in","the","existing","embedding","for","every","new","data","point","."]
code: def to_new(self, data, return_distances=False):
      """Compute the affinities of new samples to the initial samples.
  
      This is necessary for embedding new data points into an existing
      embedding.
  
      Parameters
      ----------
      data: np.ndarray
          The data points to be added to the existing embedding.
  
      return_distances: bool
          If needed, the function can return the indices of the nearest
          neighbors and their corresponding distances.
  
      Returns
      -------
      P: array_like
          An :math:`N \\times M` affinity matrix expressing interactions
          between :math:`N` new data points the initial :math:`M` data
          samples.
  
      indices: np.ndarray
          Returned if ``return_distances=True``. The indices of the :math:`k`
          nearest neighbors in the existing embedding for every new data
          point.
  
      distances: np.ndarray
          Returned if ``return_distances=True``. The distances to the
          :math:`k` nearest neighbors in the existing embedding for every new
          data point.
  
      """
  
imports: import logging
  import numbers
  import operator
  from functools import reduce
  import numpy
  import scipy.sparse
  from openTSNE import _tsne
  from openTSNE import nearest_neighbors
  from openTSNE import utils
  from openTSNE.utils import is_package_installed
  import warnings
label_desc: Use image node_id 2 for calling the Affinities obj's underlying member method code with example usage: obj.to_new(data, return_distances) without return types