class_docstr: Base class for SparsePCA and MiniBatchSparsePCA
class_docstr_tok: ["Base","class","for","SparsePCA","and","MiniBatchSparsePCA"]
code: def __init__(
      self,
      n_components=None,
      *,
      alpha=1,
      ridge_alpha=0.01,
      max_iter=1000,
      tol=1e-8,
      method="lars",
      n_jobs=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.verbose = verbose
      self.random_state = random_state
  
imports: from numbers import Integral, Real
  import numpy
  from ..base import BaseEstimator, ClassNamePrefixFeaturesOutMixin, TransformerMixin, _fit_context
  from ..linear_model import ridge_regression
  from ..utils import check_random_state
  from ..utils._param_validation import Hidden, Interval, StrOptions
  from ..utils.extmath import svd_flip
  from ..utils.validation import check_array, check_is_fitted
  from ._dict_learning import MiniBatchDictionaryLearning, dict_learning
label_desc: Use image node_id 1 to create a new _BaseSparsePCA object from inherited base classes: ClassNamePrefixFeaturesOutMixin, TransformerMixin, BaseEstimator with example: obj = _BaseSparsePCA(n_components)