class_docstr: Approximate feature map for additive chi2 kernel.
  
  Uses sampling the fourier transform of the kernel characteristic
  at regular intervals.
  
  Since the kernel that is to be approximated is additive, the components of
  the input vectors can be treated separately.  Each entry in the original
  space is transformed into 2*sample_steps-1 features, where sample_steps is
  a parameter of the method. Typical values of sample_steps include 1, 2 and
  3.
  
  Optimal choices for the sampling interval for certain data ranges can be
  computed (see the reference). The default values should be reasonable.
  
  Read more in the :ref:`User Guide <additive_chi_kernel_approx>`.
  
  Parameters
  ----------
  sample_steps : int, default=2
      Gives the number of (complex) sampling points.
  
  sample_interval : float, default=None
      Sampling interval. Must be specified when sample_steps not in {1,2,3}.
  
  Attributes
  ----------
  sample_interval_ : float
      Stored sampling interval. Specified as a parameter if `sample_steps`
      not in {1,2,3}.
  
      .. deprecated:: 1.3
         `sample_interval_` serves internal purposes only and will be removed in 1.5.
  
  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
  --------
  SkewedChi2Sampler : A Fourier-approximation to a non-additive variant of
      the chi squared kernel.
  
  sklearn.metrics.pairwise.chi2_kernel : The exact chi squared kernel.
  
  sklearn.metrics.pairwise.additive_chi2_kernel : The exact additive chi
      squared kernel.
  
  Notes
  -----
  This estimator approximates a slightly different version of the additive
  chi squared kernel then ``metric.additive_chi2`` computes.
  
  This estimator is stateless and does not need to be fitted. However, we
  recommend to call :meth:`fit_transform` instead of :meth:`transform`, as
  parameter validation is only performed in :meth:`fit`.
  
  References
  ----------
  See `"Efficient additive kernels via explicit feature maps"
  <http://www.robots.ox.ac.uk/~vedaldi/assets/pubs/vedaldi11efficient.pdf>`_
  A. Vedaldi and A. Zisserman, Pattern Analysis and Machine Intelligence,
  2011
  
  Examples
  --------
  >>> from sklearn.datasets import load_digits
  >>> from sklearn.linear_model import SGDClassifier
  >>> from sklearn.kernel_approximation import AdditiveChi2Sampler
  >>> X, y = load_digits(return_X_y=True)
  >>> chi2sampler = AdditiveChi2Sampler(sample_steps=2)
  >>> X_transformed = chi2sampler.fit_transform(X, y)
  >>> clf = SGDClassifier(max_iter=5, random_state=0, tol=1e-3)
  >>> clf.fit(X_transformed, y)
  SGDClassifier(max_iter=5, random_state=0)
  >>> clf.score(X_transformed, y)
  0.9499...
class_docstr_tok: ["Approximate","feature","map","for","additive","chi2","kernel",".","Uses","sampling","the","fourier","transform","of","the","kernel","characteristic","at","regular","intervals",".","Since","the","kernel","that","is","to","be","approximated","is","additive",",","the","components","of","the","input","vectors","can","be","treated","separately",".","Each","entry","in","the","original","space","is","transformed","into","2","*","sample_steps-1","features",",","where","sample_steps","is","a","parameter","of","the","method",".","Typical","values","of","sample_steps","include","1",",","2","and","3",".","Optimal","choices","for","the","sampling","interval","for","certain","data","ranges","can","be","computed","(","see","the","reference",")",".","The","default","values","should","be","reasonable",".","Read","more","in","the",":","ref",":","`","User","Guide","<","additive_chi_kernel_approx",">","`",".","Parameters","--","--","--","--","--","sample_steps",":","int",",","default=2","Gives","the","number","of","(","complex",")","sampling","points",".","sample_interval",":","float",",","default=None","Sampling","interval",".","Must","be","specified","when","sample_steps","not","in","{","1,2,3","}",".","Attributes","--","--","--","--","--","sample_interval_",":","float","Stored","sampling","interval",".","Specified","as","a","parameter","if","`","sample_steps","`","not","in","{","1,2,3","}",".","..","deprecated",":",":","1.3","`","sample_interval_","`","serves","internal","purposes","only","and","will","be","removed","in","1.5.","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","--","--","--","--","SkewedChi2Sampler",":","A","Fourier-approximation","to","a","non-additive","variant","of","the","chi","squared","kernel",".","sklearn.metrics.pairwise.chi2_kernel",":","The","exact","chi","squared","kernel",".","sklearn.metrics.pairwise.additive_chi2_kernel",":","The","exact","additive","chi","squared","kernel",".","Notes","--","--","-","This","estimator","approximates","a","slightly","different","version","of","the","additive","chi","squared","kernel","then","``","metric.additive_chi2","``","computes",".","This","estimator","is","stateless","and","does","not","need","to","be","fitted",".","However",",","we","recommend","to","call",":","meth",":","`","fit_transform","`","instead","of",":","meth",":","`","transform","`",",","as","parameter","validation","is","only","performed","in",":","meth",":","`","fit","`",".","References","--","--","--","--","--","See","`","``","Efficient","additive","kernels","via","explicit","feature","maps","''","<","http",":","\/\/www.robots.ox.ac.uk\/~vedaldi\/assets\/pubs\/vedaldi11efficient.pdf",">","`","_","A.","Vedaldi","and","A.","Zisserman",",","Pattern","Analysis","and","Machine","Intelligence",",","2011","Examples","--","--","--","--",">",">",">","from","sklearn.datasets","import","load_digits",">",">",">","from","sklearn.linear_model","import","SGDClassifier",">",">",">","from","sklearn.kernel_approximation","import","AdditiveChi2Sampler",">",">",">","X",",","y","=","load_digits","(","return_X_y=True",")",">",">",">","chi2sampler","=","AdditiveChi2Sampler","(","sample_steps=2",")",">",">",">","X_transformed","=","chi2sampler.fit_transform","(","X",",","y",")",">",">",">","clf","=","SGDClassifier","(","max_iter=5",",","random_state=0",",","tol=1e-3",")",">",">",">","clf.fit","(","X_transformed",",","y",")","SGDClassifier","(","max_iter=5",",","random_state=0",")",">",">",">","clf.score","(","X_transformed",",","y",")","0.9499","..."]
docstr: Only validates estimator's parameters.
  
  This method allows to: (i) validate the estimator's parameters and
  (ii) be consistent with the scikit-learn transformer API.
  
  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 transformer.
code: def fit(self, X, y=None):
      """Only validates estimator's parameters.
  
          This method allows to: (i) validate the estimator's parameters and
          (ii) be consistent with the scikit-learn transformer API.
  
          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 transformer.
          """
      X = self._validate_data(X, accept_sparse="csr")
      check_non_negative(X, "X in AdditiveChi2Sampler.fit")
  
      # TODO(1.5): remove the setting of _sample_interval from fit
      if self.sample_interval is None:
          # See figure 2 c) of "Efficient additive kernels via explicit feature maps"
          # <http://www.robots.ox.ac.uk/~vedaldi/assets/pubs/vedaldi11efficient.pdf>
          # A. Vedaldi and A. Zisserman, Pattern Analysis and Machine Intelligence,
          # 2011
          if self.sample_steps == 1:
              self._sample_interval = 0.8
          elif self.sample_steps == 2:
              self._sample_interval = 0.5
          elif self.sample_steps == 3:
              self._sample_interval = 0.4
          else:
              raise ValueError(
                  "If sample_steps is not in [1, 2, 3],"
                  " you need to provide sample_interval"
              )
      else:
          self._sample_interval = self.sample_interval
  
      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 AdditiveChi2Sampler obj's underlying member method code with example usage: obj.fit(X, y) and returns: self