class_docstr: Approximate feature map for "skewed chi-squared" kernel.
  
  Read more in the :ref:`User Guide <skewed_chi_kernel_approx>`.
  
  Parameters
  ----------
  skewedness : float, default=1.0
      "skewedness" parameter of the kernel. Needs to be cross-validated.
  
  n_components : int, default=100
      Number of Monte Carlo samples per original feature.
      Equals the dimensionality of the computed feature space.
  
  random_state : int, RandomState instance or None, default=None
      Pseudo-random number generator to control the generation of the random
      weights and random offset when fitting the training data.
      Pass an int for reproducible output across multiple function calls.
      See :term:`Glossary <random_state>`.
  
  Attributes
  ----------
  random_weights_ : ndarray of shape (n_features, n_components)
      Weight array, sampled from a secant hyperbolic distribution, which will
      be used to linearly transform the log of the data.
  
  random_offset_ : ndarray of shape (n_features, n_components)
      Bias term, which will be added to the data. It is uniformly distributed
      between 0 and 2*pi.
  
  n_features_in_ : int
      Number of features seen during :term:`fit`.
  
      .. versionadded:: 0.24
  
  feature_names_in_ : ndarray of shape (`n_features_in_`,)
      Names of features seen during :term:`fit`. Defined only when `X`
      has feature names that are all strings.
  
      .. versionadded:: 1.0
  
  See Also
  --------
  AdditiveChi2Sampler : Approximate feature map for additive chi2 kernel.
  Nystroem : Approximate a kernel map using a subset of the training data.
  RBFSampler : Approximate a RBF kernel feature map using random Fourier
      features.
  SkewedChi2Sampler : Approximate feature map for "skewed chi-squared" kernel.
  sklearn.metrics.pairwise.chi2_kernel : The exact chi squared kernel.
  sklearn.metrics.pairwise.kernel_metrics : List of built-in kernels.
  
  References
  ----------
  See "Random Fourier Approximations for Skewed Multiplicative Histogram
  Kernels" by Fuxin Li, Catalin Ionescu and Cristian Sminchisescu.
  
  Examples
  --------
  >>> from sklearn.kernel_approximation import SkewedChi2Sampler
  >>> from sklearn.linear_model import SGDClassifier
  >>> X = [[0, 0], [1, 1], [1, 0], [0, 1]]
  >>> y = [0, 0, 1, 1]
  >>> chi2_feature = SkewedChi2Sampler(skewedness=.01,
  ...                                  n_components=10,
  ...                                  random_state=0)
  >>> X_features = chi2_feature.fit_transform(X, y)
  >>> clf = SGDClassifier(max_iter=10, tol=1e-3)
  >>> clf.fit(X_features, y)
  SGDClassifier(max_iter=10)
  >>> clf.score(X_features, y)
  1.0
class_docstr_tok: ["Approximate","feature","map","for","``","skewed","chi-squared","''","kernel",".","Read","more","in","the",":","ref",":","`","User","Guide","<","skewed_chi_kernel_approx",">","`",".","Parameters","--","--","--","--","--","skewedness",":","float",",","default=1.0","``","skewedness","''","parameter","of","the","kernel",".","Needs","to","be","cross-validated",".","n_components",":","int",",","default=100","Number","of","Monte","Carlo","samples","per","original","feature",".","Equals","the","dimensionality","of","the","computed","feature","space",".","random_state",":","int",",","RandomState","instance","or","None",",","default=None","Pseudo-random","number","generator","to","control","the","generation","of","the","random","weights","and","random","offset","when","fitting","the","training","data",".","Pass","an","int","for","reproducible","output","across","multiple","function","calls",".","See",":","term",":","`","Glossary","<","random_state",">","`",".","Attributes","--","--","--","--","--","random_weights_",":","ndarray","of","shape","(","n_features",",","n_components",")","Weight","array",",","sampled","from","a","secant","hyperbolic","distribution",",","which","will","be","used","to","linearly","transform","the","log","of","the","data",".","random_offset_",":","ndarray","of","shape","(","n_features",",","n_components",")","Bias","term",",","which","will","be","added","to","the","data",".","It","is","uniformly","distributed","between","0","and","2","*","pi",".","n_features_in_",":","int","Number","of","features","seen","during",":","term",":","`","fit","`",".","..","versionadded",":",":","0.24","feature_names_in_",":","ndarray","of","shape","(","`","n_features_in_","`",",",")","Names","of","features","seen","during",":","term",":","`","fit","`",".","Defined","only","when","`","X","`","has","feature","names","that","are","all","strings",".","..","versionadded",":",":","1.0","See","Also","--","--","--","--","AdditiveChi2Sampler",":","Approximate","feature","map","for","additive","chi2","kernel",".","Nystroem",":","Approximate","a","kernel","map","using","a","subset","of","the","training","data",".","RBFSampler",":","Approximate","a","RBF","kernel","feature","map","using","random","Fourier","features",".","SkewedChi2Sampler",":","Approximate","feature","map","for","``","skewed","chi-squared","''","kernel",".","sklearn.metrics.pairwise.chi2_kernel",":","The","exact","chi","squared","kernel",".","sklearn.metrics.pairwise.kernel_metrics",":","List","of","built-in","kernels",".","References","--","--","--","--","--","See","``","Random","Fourier","Approximations","for","Skewed","Multiplicative","Histogram","Kernels","''","by","Fuxin","Li",",","Catalin","Ionescu","and","Cristian","Sminchisescu",".","Examples","--","--","--","--",">",">",">","from","sklearn.kernel_approximation","import","SkewedChi2Sampler",">",">",">","from","sklearn.linear_model","import","SGDClassifier",">",">",">","X","=","[","[","0",",","0","]",",","[","1",",","1","]",",","[","1",",","0","]",",","[","0",",","1","]","]",">",">",">","y","=","[","0",",","0",",","1",",","1","]",">",">",">","chi2_feature","=","SkewedChi2Sampler","(","skewedness=.01",",","...","n_components=10",",","...","random_state=0",")",">",">",">","X_features","=","chi2_feature.fit_transform","(","X",",","y",")",">",">",">","clf","=","SGDClassifier","(","max_iter=10",",","tol=1e-3",")",">",">",">","clf.fit","(","X_features",",","y",")","SGDClassifier","(","max_iter=10",")",">",">",">","clf.score","(","X_features",",","y",")","1.0"]
docstr: Fit the model with X.
  
  Samples random projection according to n_features.
  
  Parameters
  ----------
  X : array-like, shape (n_samples, n_features)
      Training data, where `n_samples` is the number of samples
      and `n_features` is the number of features.
  
  y : array-like, shape (n_samples,) or (n_samples, n_outputs),                 default=None
      Target values (None for unsupervised transformations).
  
  Returns
  -------
  self : object
      Returns the instance itself.
code: def fit(self, X, y=None):
      """Fit the model with X.
  
          Samples random projection according to n_features.
  
          Parameters
          ----------
          X : array-like, shape (n_samples, n_features)
              Training data, where `n_samples` is the number of samples
              and `n_features` is the number of features.
  
          y : array-like, shape (n_samples,) or (n_samples, n_outputs), \
                  default=None
              Target values (None for unsupervised transformations).
  
          Returns
          -------
          self : object
              Returns the instance itself.
          """
      X = self._validate_data(X)
      random_state = check_random_state(self.random_state)
      n_features = X.shape[1]
      uniform = random_state.uniform(
          size=(n_features, self.n_components)
      )
      # transform by inverse CDF of sech
      self.random_weights_ = (
          1.0 / np.pi * np.log(np.tan(np.pi / 2.0 * uniform))
      )
      self.random_offset_ = random_state.uniform(
          0, 2 * np.pi, size=self.n_components
      )
  
      if X.dtype == np.float32:
          # Setting the data type of the fitted attribute will ensure the
          # output data type during `transform`.
          self.random_weights_ = self.random_weights_.astype(
              X.dtype, copy=False
          )
          self.random_offset_ = self.random_offset_.astype(
              X.dtype, copy=False
          )
  
      self._n_features_out = self.n_components
      return self
  
imports: import warnings
  from numbers import Integral, Real
  import numpy
  import scipy.sparse
  from scipy.linalg import svd
  from .base import BaseEstimator, ClassNamePrefixFeaturesOutMixin, TransformerMixin, _fit_context
  from .metrics.pairwise import KERNEL_PARAMS, PAIRWISE_KERNEL_FUNCTIONS, pairwise_kernels
  from .utils import check_random_state, deprecated
  from .utils._param_validation import Interval, StrOptions
  from .utils.extmath import safe_sparse_dot
  from .utils.validation import _check_feature_names_in, check_is_fitted, check_non_negative
label_desc: Use image node_id 2 for calling the SkewedChi2Sampler obj's underlying member method code with example usage: obj.fit(X, y) and returns: self