docstr: Select Features via a gradient based search on (X, y) on the given samples.
  Can be called repeatedly with different X and y to handle streaming datasets.
  
  Parameters
  ----------
  X : array-like
      Shape = [n_samples, n_features]
      The training input samples.
  y :  array-like
      Shape = [n_samples]
      The target values (class labels in classification, real numbers in
      regression).
  n_classes : int
      Number of classes
      Classes across all calls to partial_fit.
      Can be obtained by via `np.unique(y_all).shape[0]`, where y_all is the
      target vector of the entire dataset.
      This argument is expected for the first call to partial_fit,
      otherwise will assume all classes are present in the batch of y given.
      It will be ignored in the subsequent calls.
      Note that y doesn't need to contain all labels in `classes`.
  groups : array-like
      Optional, shape = [n_features]
      Groups of columns that must be selected as a unit
      e.g. [0, 0, 1, 2] specifies the first two columns are part of a group.
      This argument is expected for the first call to partial_fit,
      otherwise will assume all classes are present in the batch of y given.
      It will be ignored in the subsequent calls.
docstr_tok: ["Select","Features","via","a","gradient","based","search","on","(","X",",","y",")","on","the","given","samples",".","Can","be","called","repeatedly","with","different","X","and","y","to","handle","streaming","datasets",".","Parameters","--","--","--","--","--","X",":","array-like","Shape","=","[","n_samples",",","n_features","]","The","training","input","samples",".","y",":","array-like","Shape","=","[","n_samples","]","The","target","values","(","class","labels","in","classification",",","real","numbers","in","regression",")",".","n_classes",":","int","Number","of","classes","Classes","across","all","calls","to","partial_fit",".","Can","be","obtained","by","via","`","np.unique","(","y_all",")",".shape","[","0","]","`",",","where","y_all","is","the","target","vector","of","the","entire","dataset",".","This","argument","is","expected","for","the","first","call","to","partial_fit",",","otherwise","will","assume","all","classes","are","present","in","the","batch","of","y","given",".","It","will","be","ignored","in","the","subsequent","calls",".","Note","that","y","does","n't","need","to","contain","all","labels","in","`","classes","`",".","groups",":","array-like","Optional",",","shape","=","[","n_features","]","Groups","of","columns","that","must","be","selected","as","a","unit","e.g",".","[","0",",","0",",","1",",","2","]","specifies","the","first","two","columns","are","part","of","a","group",".","This","argument","is","expected","for","the","first","call","to","partial_fit",",","otherwise","will","assume","all","classes","are","present","in","the","batch","of","y","given",".","It","will","be","ignored","in","the","subsequent","calls","."]
code: def partial_fit(self, X, y, n_classes=None, groups=None):
      """
      Select Features via a gradient based search on (X, y) on the given samples.
      Can be called repeatedly with different X and y to handle streaming datasets.
  
      Parameters
      ----------
      X : array-like
          Shape = [n_samples, n_features]
          The training input samples.
      y :  array-like
          Shape = [n_samples]
          The target values (class labels in classification, real numbers in
          regression).
      n_classes : int
          Number of classes
          Classes across all calls to partial_fit.
          Can be obtained by via `np.unique(y_all).shape[0]`, where y_all is the
          target vector of the entire dataset.
          This argument is expected for the first call to partial_fit,
          otherwise will assume all classes are present in the batch of y given.
          It will be ignored in the subsequent calls.
          Note that y doesn't need to contain all labels in `classes`.
      groups : array-like
          Optional, shape = [n_features]
          Groups of columns that must be selected as a unit
          e.g. [0, 0, 1, 2] specifies the first two columns are part of a group.
          This argument is expected for the first call to partial_fit,
          otherwise will assume all classes are present in the batch of y given.
          It will be ignored in the subsequent calls.
      """
      try:
          self._partial_fit(X, y, n_classes=n_classes, groups=groups)
      except constants.NanError:
          if hasattr(self, "_prev_checkpoint"):
              # if it's already done some batches successfully just ignore it
              print("failed fitting this batch, loss was nan")
          else:
              # if this is the first batch, reset and try with doubles
              if self.verbose:
                  print("Loss was nan, trying with Doubles")
              self._reset()
              torch.set_default_tensor_type(torch.DoubleTensor)
              self._partial_fit(
                  X, y, n_classes=n_classes, groups=groups
              )
  
      return self
  
imports: import time
  import numpy
  import pandas
  from sklearn.base import BaseEstimator
  from sklearn.feature_selection import SelectorMixin
  from sklearn.utils.validation import check_is_fitted
  import torch
  from nni.feature_engineering.feature_selector import FeatureSelector
  from .None import constants
  from .fginitialize import PrepareData
  from .fgtrain import _train
label_desc: Use image node_id 2 for calling the FeatureGradientSelector obj's underlying member method code with example usage: obj.partial_fit(X, y, n_classes, groups) and returns: self