class_docstr: Base class for NMF and MiniBatchNMF.
class_docstr_tok: ["Base","class","for","NMF","and","MiniBatchNMF","."]
docstr: Learn a NMF model for the data X.
  
  Parameters
  ----------
  X : {array-like, sparse matrix} of shape (n_samples, n_features)
      Training vector, where `n_samples` is the number of samples
      and `n_features` is the number of features.
  
  y : Ignored
      Not used, present for API consistency by convention.
  
  **params : kwargs
      Parameters (keyword arguments) and values passed to
      the fit_transform instance.
  
  Returns
  -------
  self : object
      Returns the instance itself.
code: def fit(self, X, y=None, **params):
      """Learn a NMF model for the data X.
  
      Parameters
      ----------
      X : {array-like, sparse matrix} of shape (n_samples, n_features)
          Training vector, where `n_samples` is the number of samples
          and `n_features` is the number of features.
  
      y : Ignored
          Not used, present for API consistency by convention.
  
      **params : kwargs
          Parameters (keyword arguments) and values passed to
          the fit_transform instance.
  
      Returns
      -------
      self : object
          Returns the instance itself.
      """
      # param validation is done in fit_transform
  
      self.fit_transform(X, **params)
      return self
  
imports: import itertools
  import time
  import warnings
  from abc import ABC
  from math import sqrt
  from numbers import Integral, Real
  import numpy
  import scipy.sparse
  from scipy import linalg
  from .._config import config_context
  from ..base import BaseEstimator, ClassNamePrefixFeaturesOutMixin, TransformerMixin, _fit_context
  from ..exceptions import ConvergenceWarning
  from ..utils import check_array, check_random_state, gen_batches, metadata_routing
  from ..utils._param_validation import Hidden, Interval, StrOptions, validate_params
  from ..utils.extmath import randomized_svd, safe_sparse_dot, squared_norm
  from ..utils.validation import check_is_fitted, check_non_negative
  from ._cdnmf_fast import _update_cdnmf_fast
label_desc: Use image node_id 5 for calling the _BaseNMF obj's underlying member method code with example usage: obj.fit(X, y) and returns: self