class_docstr: The base selection object.
  
  This object defines the structures that all submodular selection algorithms
  should follow. All algorithms will have the same public methods and the
  same attributes.
  
  Parameters
  ----------
  n_samples : int
          The number of samples to return.
  
  initial_subset : list, numpy.ndarray or None, optional
          If provided, this should be a list of indices into the data matrix
          to use as the initial subset, or a group of examples that may not be
          in the provided data should beused as the initial subset. If indices, 
          the provided array should be one-dimensional. If a group of examples,
          the data should be 2 dimensional.
  
  optimizer : string or optimizers.BaseOptimizer, optional
          The optimization approach to use for the selection. Default is
          'two-stage', which makes selections using the naive greedy algorithm
          initially and then switches to the lazy greedy algorithm. Must be
          one of
  
                  'naive' : the naive greedy algorithm
                  'lazy' : the lazy (or accelerated) greedy algorithm
                  'approximate-lazy' : the approximate lazy greedy algorithm
                  'two-stage' : starts with naive and switches to lazy
                  'stochastic' : the stochastic greedy algorithm
                  'greedi' : the GreeDi distributed algorithm
                  'bidirectional' : the bidirectional greedy algorithm
  
          Default is 'naive'.
  
  optimizer_kwds : dict or None
          A dictionary of arguments to pass into the optimizer object. The keys
          of this dictionary should be the names of the parameters in the optimizer
          and the values in the dictionary should be the values that these
          parameters take. Default is None.
  
  reservoir : numpy.ndarray or None
          The reservoir to use when calculating gains in the sieve greedy
          streaming optimization algorithm in the `partial_fit` method.
          Currently only used for graph-based functions. If a numpy array
          is passed in, it will be used as the reservoir. If None is passed in,
          will use reservoir sampling to collect a reservoir. Default is None.
  
  max_reservoir_size : int 
          The maximum size that the reservoir can take. If a reservoir is passed
          in, this value is set to the size of that array. Default is 1000.
  
  n_jobs : int
          The number of threads to use when performing computation in parallel.
          Currently, this parameter is exposed but does not actually do anything.
          This will be fixed soon.
  
  random_state : int or RandomState or None, optional
          The random seed to use for the random selection process. Only used
          for stochastic greedy.
  
  verbose : bool
          Whether to print output during the selection process.
  
  Attributes
  ----------
  n_samples : int
          The number of samples to select.
  
  ranking : numpy.array int
          The selected samples in the order of their gain with the first number in
          the ranking corresponding to the index of the first sample that was
          selected by the greedy procedure.
  
  gains : numpy.array float
          The gain of each sample in the returned set when it was added to the
          growing subset. The first number corresponds to the gain of the first
          added sample, the second corresponds to the gain of the second added
          sample, and so forth.
class_docstr_tok: ["The","base","selection","object",".","This","object","defines","the","structures","that","all","submodular","selection","algorithms","should","follow",".","All","algorithms","will","have","the","same","public","methods","and","the","same","attributes",".","Parameters","--","--","--","--","--","n_samples",":","int","The","number","of","samples","to","return",".","initial_subset",":","list",",","numpy.ndarray","or","None",",","optional","If","provided",",","this","should","be","a","list","of","indices","into","the","data","matrix","to","use","as","the","initial","subset",",","or","a","group","of","examples","that","may","not","be","in","the","provided","data","should","beused","as","the","initial","subset",".","If","indices",",","the","provided","array","should","be","one-dimensional",".","If","a","group","of","examples",",","the","data","should","be","2","dimensional",".","optimizer",":","string","or","optimizers.BaseOptimizer",",","optional","The","optimization","approach","to","use","for","the","selection",".","Default","is","'two-stage","'",",","which","makes","selections","using","the","naive","greedy","algorithm","initially","and","then","switches","to","the","lazy","greedy","algorithm",".","Must","be","one","of","'naive","'",":","the","naive","greedy","algorithm","'lazy","'",":","the","lazy","(","or","accelerated",")","greedy","algorithm","'approximate-lazy","'",":","the","approximate","lazy","greedy","algorithm","'two-stage","'",":","starts","with","naive","and","switches","to","lazy","'stochastic","'",":","the","stochastic","greedy","algorithm","'greedi","'",":","the","GreeDi","distributed","algorithm","'bidirectional","'",":","the","bidirectional","greedy","algorithm","Default","is","'naive","'",".","optimizer_kwds",":","dict","or","None","A","dictionary","of","arguments","to","pass","into","the","optimizer","object",".","The","keys","of","this","dictionary","should","be","the","names","of","the","parameters","in","the","optimizer","and","the","values","in","the","dictionary","should","be","the","values","that","these","parameters","take",".","Default","is","None",".","reservoir",":","numpy.ndarray","or","None","The","reservoir","to","use","when","calculating","gains","in","the","sieve","greedy","streaming","optimization","algorithm","in","the","`","partial_fit","`","method",".","Currently","only","used","for","graph-based","functions",".","If","a","numpy","array","is","passed","in",",","it","will","be","used","as","the","reservoir",".","If","None","is","passed","in",",","will","use","reservoir","sampling","to","collect","a","reservoir",".","Default","is","None",".","max_reservoir_size",":","int","The","maximum","size","that","the","reservoir","can","take",".","If","a","reservoir","is","passed","in",",","this","value","is","set","to","the","size","of","that","array",".","Default","is","1000.","n_jobs",":","int","The","number","of","threads","to","use","when","performing","computation","in","parallel",".","Currently",",","this","parameter","is","exposed","but","does","not","actually","do","anything",".","This","will","be","fixed","soon",".","random_state",":","int","or","RandomState","or","None",",","optional","The","random","seed","to","use","for","the","random","selection","process",".","Only","used","for","stochastic","greedy",".","verbose",":","bool","Whether","to","print","output","during","the","selection","process",".","Attributes","--","--","--","--","--","n_samples",":","int","The","number","of","samples","to","select",".","ranking",":","numpy.array","int","The","selected","samples","in","the","order","of","their","gain","with","the","first","number","in","the","ranking","corresponding","to","the","index","of","the","first","sample","that","was","selected","by","the","greedy","procedure",".","gains",":","numpy.array","float","The","gain","of","each","sample","in","the","returned","set","when","it","was","added","to","the","growing","subset",".","The","first","number","corresponds","to","the","gain","of","the","first","added","sample",",","the","second","corresponds","to","the","gain","of","the","second","added","sample",",","and","so","forth","."]
code: def partial_fit(
      self, X, y=None, sample_weight=None, sample_cost=None
  ):
      allowed_dtypes = list, numpy.ndarray, csr_matrix
  
      if not isinstance(X, allowed_dtypes):
          raise ValueError(
              "X must be either a list of lists, a 2D numpy "
              "array, or a scipy.sparse.csr_matrix."
          )
      if isinstance(X, numpy.ndarray) and len(X.shape) != 2:
          raise ValueError("X must have exactly two dimensions.")
  
      if not self.sparse:
          if X.dtype != "float64":
              X = X.astype("float64")
  
      if not isinstance(self.optimizer, SieveGreedy):
          self.optimizer = OPTIMIZERS["sieve"](
              function=self,
              verbose=self.verbose,
              random_state=self.random_state,
              **self.optimizer_kwds,
          )
  
      self._X = X if self._X is None else self._X
      self._initialize(X)
  
      if self.verbose:
          self.pbar = tqdm(total=self.n_samples, unit_scale=True)
  
      self.optimizer.select(X, self.n_samples, sample_cost=sample_cost)
  
      if self.verbose == True:
          self.pbar.close()
  
      self.ranking = numpy.array(self.ranking)
      self.gains = numpy.array(self.gains)
      self._X = None
      return self
  
imports: import numpy
  from tqdm import tqdm
  from ..optimizers import BaseOptimizer
  from ..optimizers import NaiveGreedy
  from ..optimizers import LazyGreedy
  from ..optimizers import ApproximateLazyGreedy
  from ..optimizers import TwoStageGreedy
  from ..optimizers import StochasticGreedy
  from ..optimizers import BidirectionalGreedy
  from ..optimizers import GreeDi
  from ..optimizers import SieveGreedy
  from ..optimizers import OPTIMIZERS
  from ..utils import PriorityQueue
  from ..utils import check_random_state
  from ..utils import _calculate_pairwise_distances
  from scipy.sparse import csr_matrix
label_desc: Use image node_id 3 for calling the BaseSelection obj's underlying member method code with example usage: obj.partial_fit(X, y, sample_weight, sample_cost) and returns: self