class_docstr: Use a precomputed affinity matrix.
  
  Parameters
  ----------
  affinities: scipy.sparse.csr_matrix, np.ndarray
      An N x N matrix containing the affinities.
  normalize: bool
      Normalize the affinity matrix to sum to 1. Default is True.
class_docstr_tok: ["Use","a","precomputed","affinity","matrix",".","Parameters","--","--","--","--","--","affinities",":","scipy.sparse.csr_matrix",",","np.ndarray","An","N","x","N","matrix","containing","the","affinities",".","normalize",":","bool","Normalize","the","affinity","matrix","to","sum","to","1",".","Default","is","True","."]
code: def __init__(self, affinities, normalize=True):
      if not isinstance(affinities, sp.csr_matrix):
          affinities = sp.csr_matrix(affinities)
      if normalize:
          affinities /= np.sum(affinities)
      self.P = affinities
  
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 1 to create a new PrecomputedAffinities object from inherited base classes: Affinities with example: obj = PrecomputedAffinities(affinities, normalize)