class_docstr: Performs spectral clustering using sklearn on embeddings.
class_docstr_tok: ["Performs","spectral","clustering","using","sklearn","on","embeddings","."]
docstr: Performs spectral clustering using sklearn on embeddings.
  
  Arguments
  ---------
  X : array (n_samples, n_features)
      Embeddings to be clustered.
  n_neighbors : int
      Number of neighbors in estimating affinity matrix.
  
  Reference
  ---------
  https://github.com/scikit-learn/scikit-learn/blob/0fb307bf3/sklearn/cluster/_spectral.py
docstr_tok: ["Performs","spectral","clustering","using","sklearn","on","embeddings",".","Arguments","--","--","--","--","-","X",":","array","(","n_samples",",","n_features",")","Embeddings","to","be","clustered",".","n_neighbors",":","int","Number","of","neighbors","in","estimating","affinity","matrix",".","Reference","--","--","--","--","-","https",":","\/\/github.com\/scikit-learn\/scikit-learn\/blob\/0fb307bf3\/sklearn\/cluster\/_spectral.py"]
code: def perform_sc(self, X, n_neighbors=10):
      """
      Performs spectral clustering using sklearn on embeddings.
  
      Arguments
      ---------
      X : array (n_samples, n_features)
          Embeddings to be clustered.
      n_neighbors : int
          Number of neighbors in estimating affinity matrix.
  
      Reference
      ---------
      https://github.com/scikit-learn/scikit-learn/blob/0fb307bf3/sklearn/cluster/_spectral.py
      """
  
      # Computation of affinity matrix
      connectivity = kneighbors_graph(
          X,
          n_neighbors=n_neighbors,
          include_self=True,
      )
      self.affinity_matrix_ = 0.5 * (connectivity + connectivity.T)
  
      # Perform spectral clustering on affinity matrix
      self.labels_ = spectral_clustering_sb(
          self.affinity_matrix_,
          n_clusters=self.n_clusters,
      )
      return self
  
imports: import csv
  import numbers
  import warnings
  import scipy
  import pytest
  import numpy
  from scipy import sparse
  from scipy.sparse.linalg import eigsh
  from scipy.sparse.csgraph import connected_components
  from scipy.sparse.csgraph import laplacian
label_desc: Use image node_id 1 for calling the Spec_Cluster obj's underlying member method code with example usage: obj.perform_sc(X, n_neighbors) and returns: self