class_docstr: Polynomial kernel approximation via Tensor Sketch.
  
  Implements Tensor Sketch, which approximates the feature map
  of the polynomial kernel::
  
      K(X, Y) = (gamma * <X, Y> + coef0)^degree
  
  by efficiently computing a Count Sketch of the outer product of a
  vector with itself using Fast Fourier Transforms (FFT). Read more in the
  :ref:`User Guide <polynomial_kernel_approx>`.
  
  .. versionadded:: 0.24
  
  Parameters
  ----------
  gamma : float, default=1.0
      Parameter of the polynomial kernel whose feature map
      will be approximated.
  
  degree : int, default=2
      Degree of the polynomial kernel whose feature map
      will be approximated.
  
  coef0 : int, default=0
      Constant term of the polynomial kernel whose feature map
      will be approximated.
  
  n_components : int, default=100
      Dimensionality of the output feature space. Usually, `n_components`
      should be greater than the number of features in input samples in
      order to achieve good performance. The optimal score / run time
      balance is typically achieved around `n_components` = 10 * `n_features`,
      but this depends on the specific dataset being used.
  
  random_state : int, RandomState instance, default=None
      Determines random number generation for indexHash and bitHash
      initialization. Pass an int for reproducible results across multiple
      function calls. See :term:`Glossary <random_state>`.
  
  Attributes
  ----------
  indexHash_ : ndarray of shape (degree, n_features), dtype=int64
      Array of indexes in range [0, n_components) used to represent
      the 2-wise independent hash functions for Count Sketch computation.
  
  bitHash_ : ndarray of shape (degree, n_features), dtype=float32
      Array with random entries in {+1, -1}, used to represent
      the 2-wise independent hash functions for Count Sketch computation.
  
  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.kernel_metrics : List of built-in kernels.
  
  Examples
  --------
  >>> from sklearn.kernel_approximation import PolynomialCountSketch
  >>> from sklearn.linear_model import SGDClassifier
  >>> X = [[0, 0], [1, 1], [1, 0], [0, 1]]
  >>> y = [0, 0, 1, 1]
  >>> ps = PolynomialCountSketch(degree=3, random_state=1)
  >>> X_features = ps.fit_transform(X)
  >>> clf = SGDClassifier(max_iter=10, tol=1e-3)
  >>> clf.fit(X_features, y)
  SGDClassifier(max_iter=10)
  >>> clf.score(X_features, y)
  1.0
  
  For a more detailed example of usage, see
  :ref:`sphx_glr_auto_examples_kernel_approximation_plot_scalable_poly_kernels.py`
code: def __init__(
      self,
      *,
      gamma=1.0,
      degree=2,
      coef0=0,
      n_components=100,
      random_state=None,
  ):
      self.gamma = gamma
      self.degree = degree
      self.coef0 = coef0
      self.n_components = n_components
      self.random_state = random_state
  
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 1 to create a new PolynomialCountSketch object from inherited base classes: ClassNamePrefixFeaturesOutMixin, TransformerMixin, BaseEstimator with example: obj = PolynomialCountSketch()