class_docstr: Use unsupervised spatial filtering across time and samples.
  
  Parameters
  ----------
  estimator : instance of sklearn.base.BaseEstimator
      Estimator using some decomposition algorithm.
  average : bool, default False
      If True, the estimator is fitted on the average across samples
      (e.g. epochs).
docstr: Fit the spatial filters.
  
  Parameters
  ----------
  X : array, shape (n_epochs, n_channels, n_times)
      The data to be filtered.
  y : None | array, shape (n_samples,)
      Used for scikit-learn compatibility.
  
  Returns
  -------
  self : instance of UnsupervisedSpatialFilter
      Return the modified instance.
docstr_tok: ["Fit","the","spatial","filters",".","Parameters","--","--","--","--","--","X",":","array",",","shape","(","n_epochs",",","n_channels",",","n_times",")","The","data","to","be","filtered",".","y",":","None","|","array",",","shape","(","n_samples",",",")","Used","for","scikit-learn","compatibility",".","Returns","--","--","--","-","self",":","instance","of","UnsupervisedSpatialFilter","Return","the","modified","instance","."]
code: def fit(self, X, y=None):
      """Fit the spatial filters.
  
      Parameters
      ----------
      X : array, shape (n_epochs, n_channels, n_times)
          The data to be filtered.
      y : None | array, shape (n_samples,)
          Used for scikit-learn compatibility.
  
      Returns
      -------
      self : instance of UnsupervisedSpatialFilter
          Return the modified instance.
      """
      if self.average:
          X = np.mean(X, axis=0).T
      else:
          n_epochs, n_channels, n_times = X.shape
          # trial as time samples
          X = (
              np.transpose(X, (1, 0, 2))
              .reshape((n_channels, n_epochs * n_times))
              .T
          )
      self.estimator.fit(X)
      return self
  
imports: import numpy
  from .._fiff.pick import _pick_data_channels, _picks_by_type, _picks_to_idx, pick_info, pick_types
  from ..cov import _check_scalings_user
  from ..filter import filter_data
  from ..time_frequency import psd_array_multitaper
  from ..utils import _check_option, _validate_type, fill_doc, verbose
  from .base import BaseEstimator
  from .mixin import TransformerMixin
label_desc: Use image node_id 2 for calling the UnsupervisedSpatialFilter obj's underlying member method code with example usage: obj.fit(X, y) and returns: self