docstr: Nystroem Approximation of a kernel.
  
  Parameters
  ----------
  kernel
      Kernel function.
  n_components
      Number of components in the Nystroem approximation. By default uses all of them.
docstr_tok: ["Nystroem","Approximation","of","a","kernel",".","Parameters","--","--","--","--","--","kernel","Kernel","function",".","n_components","Number","of","components","in","the","Nystroem","approximation",".","By","default","uses","all","of","them","."]
code: def __init__(
      self, kernel: Callable, n_components: Optional[int] = None
  ) -> None:
      """Nystroem Approximation of a kernel.
  
      Parameters
      ----------
      kernel
          Kernel function.
      n_components
          Number of components in the Nystroem approximation. By default uses all of them.
      """
      self.kernel = kernel
      self.n_components = n_components
  
imports: import warnings
  from typing import Callable, Dict, Optional, Tuple
  import numpy
  import torch
  from sklearn.linear_model import SGDOneClassSVM
  from sklearn.utils.extmath import safe_sparse_dot
  from tqdm import tqdm
  from typing_extensions import Self
  from alibi_detect.od.pytorch.base import TorchOutlierDetector
  from alibi_detect.utils.pytorch.losses import hinge_loss
  from alibi_detect.utils.pytorch.kernels import GaussianRBF
  from alibi_detect.utils._types import TorchDeviceType
label_desc: Use image node_id 1 to create a new _Nystroem object  with example: obj = _Nystroem(kernel, n_components)