class_docstr: Sparse Principal Components Analysis (SparsePCA)
  
  Finds the set of sparse components that can optimally reconstruct
  the data.  The amount of sparseness is controllable by the coefficient
  of the L1 penalty, given by the parameter alpha.
  
  Read more in the :ref:`User Guide <SparsePCA>`.
  
  Parameters
  ----------
  n_components : int,
      Number of sparse atoms to extract.
  
  alpha : float,
      Sparsity controlling parameter. Higher values lead to sparser
      components.
  
  ridge_alpha : float,
      Amount of ridge shrinkage to apply in order to improve
      conditioning when calling the transform method.
  
  max_iter : int,
      Maximum number of iterations to perform.
  
  tol : float,
      Tolerance for the stopping condition.
  
  method : {'lars', 'cd'}
      lars: uses the least angle regression method to solve the lasso problem
      (linear_model.lars_path)
      cd: uses the coordinate descent method to compute the
      Lasso solution (linear_model.Lasso). Lars will be faster if
      the estimated components are sparse.
  
  n_jobs : int,
      Number of parallel jobs to run.
  
  U_init : array of shape (n_samples, n_components),
      Initial values for the loadings for warm restart scenarios.
  
  V_init : array of shape (n_components, n_features),
      Initial values for the components for warm restart scenarios.
  
  verbose :
      Degree of verbosity of the printed output.
  
  random_state : int or RandomState
      Pseudo number generator state used for random sampling.
  
  Attributes
  ----------
  components_ : array, [n_components, n_features]
      Sparse components extracted from the data.
  
  error_ : array
      Vector of errors at each iteration.
  
  n_iter_ : int
      Number of iterations run.
  
  See also
  --------
  PCA
  MiniBatchSparsePCA
  DictionaryLearning
code: def __init__(
      self,
      n_components=None,
      alpha=1,
      ridge_alpha=0.01,
      max_iter=1000,
      tol=1e-8,
      method="lars",
      n_jobs=1,
      U_init=None,
      V_init=None,
      verbose=False,
      random_state=None,
  ):
      self.n_components = n_components
      self.alpha = alpha
      self.ridge_alpha = ridge_alpha
      self.max_iter = max_iter
      self.tol = tol
      self.method = method
      self.n_jobs = n_jobs
      self.U_init = U_init
      self.V_init = V_init
      self.verbose = verbose
      self.random_state = random_state
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/decomposition/sparse_pca.py
imports: import numpy
  from ..utils import check_random_state, check_array
  from ..utils.validation import check_is_fitted
  from ..linear_model import ridge_regression
  from ..base import BaseEstimator, TransformerMixin
  from .dict_learning import dict_learning, dict_learning_online
label_desc: Use image node_id 1 to create a new SparsePCA object from inherited base classes: BaseEstimator, TransformerMixin with example: obj = SparsePCA(n_components, alpha, ridge_alpha, max_iter, tol, method, n_jobs, U_init, V_init, verbose, random_state)