class_docstr: Compute t-SNE embedding using Barnes-Hut optimization and
  multiple cores (if avaialble).
  
  Parameters mostly correspond to parameters of `sklearn.manifold.TSNE`.
  
  The following parameters are unused:
  * n_iter_without_progress
  * min_grad_norm
  * metric
  * method
  
  When `cheat_metric` is true squared equclidean distance is used to build VPTree. 
  Usually leads to same quality, yet much faster.
  
  Parameter `init` doesn't support 'pca' initialization, but a precomputed
  array can be passed.
  
  Parameter `n_iter_early_exag` defines the number of iterations out of total `n_iter`
  to spend in the early exaggeration phase of the algorithm. With default `learning_rate`,
  the default values of 250/1000 may need to be increased when embedding large numbers
  of observations. Properly setting `learning_rate` results in good embeddings with fewer 
  iterations. This interplay is discussed at https://doi.org/10.1101/451690.
class_docstr_tok: ["Compute","t-SNE","embedding","using","Barnes-Hut","optimization","and","multiple","cores","(","if","avaialble",")",".","Parameters","mostly","correspond","to","parameters","of","`","sklearn.manifold.TSNE","`",".","The","following","parameters","are","unused",":","*","n_iter_without_progress","*","min_grad_norm","*","metric","*","method","When","`","cheat_metric","`","is","true","squared","equclidean","distance","is","used","to","build","VPTree",".","Usually","leads","to","same","quality",",","yet","much","faster",".","Parameter","`","init","`","does","n't","support","'pca","'","initialization",",","but","a","precomputed","array","can","be","passed",".","Parameter","`","n_iter_early_exag","`","defines","the","number","of","iterations","out","of","total","`","n_iter","`","to","spend","in","the","early","exaggeration","phase","of","the","algorithm",".","With","default","`","learning_rate","`",",","the","default","values","of","250\/1000","may","need","to","be","increased","when","embedding","large","numbers","of","observations",".","Properly","setting","`","learning_rate","`","results","in","good","embeddings","with","fewer","iterations",".","This","interplay","is","discussed","at","https",":","\/\/doi.org\/10.1101\/451690","."]
code: def fit_transform(self, X, _y=None):
      assert X.ndim == 2, "X should be 2D array."
  
      # X may be modified, make a copy
      X = np.array(X, dtype=float, order="C", copy=True)
  
      N, D = X.shape
      init_from_Y = isinstance(self.init, np.ndarray)
      if init_from_Y:
          Y = self.init.copy("C")
          assert (
              X.shape[0] == Y.shape[0]
          ), "n_instances in init array and X must match"
      else:
          Y = np.zeros((N, self.n_components))
  
      cffi_X = self.ffi.cast("double*", X.ctypes.data)
      cffi_Y = self.ffi.cast("double*", Y.ctypes.data)
      final_error = np.array(0, dtype=float)
      cffi_final_error = self.ffi.cast(
          "double*", final_error.ctypes.data
      )
  
      t = FuncThread(
          self.C.tsne_run_double,
          cffi_X,
          N,
          D,
          cffi_Y,
          self.n_components,
          self.perplexity,
          self.angle,
          self.n_jobs,
          self.n_iter,
          self.n_iter_early_exag,
          self.random_state,
          init_from_Y,
          self.verbose,
          self.early_exaggeration,
          self.learning_rate,
          cffi_final_error,
          int(self.cheat_metric),
      )
      t.daemon = True
      t.start()
  
      while t.is_alive():
          t.join(timeout=1.0)
          sys.stdout.flush()
  
      self.embedding_ = Y
      self.kl_divergence_ = final_error
      self.n_iter_ = self.n_iter
  
      return Y
  
file_path: Multicore-TSNE/MulticoreTSNE/__init__.py
imports: from __future__ import print_function
  from glob import glob
  import threading
  import os
  import sys
  import numpy
  import cffi
label_desc: Use image node_id 3 for calling the MulticoreTSNE obj's underlying member method code with example usage: obj.fit_transform(X, _y) and returns: Y