class_docstr: Core abstraction in modAL.
  
  Args:
      estimator: The estimator to be used in the active learning loop.
      query_strategy: Function providing the query strategy for the active learning loop,
          for instance, modAL.uncertainty.uncertainty_sampling.
      force_all_finite: When True, forces all values of the data finite.
          When False, accepts np.nan and np.inf values.
      on_transformed: Whether to transform samples with the pipeline defined by the estimator
          when applying the query strategy.
      **fit_kwargs: keyword arguments.
  
  Attributes:
      estimator: The estimator to be used in the active learning loop.
      query_strategy: Function providing the query strategy for the active learning loop.
docstr: Fits self.estimator to the given data and labels.
  
  Args:
      X: The new samples for which the labels are supplied by the expert.
      y: Labels corresponding to the new instances in X.
      bootstrap: If True, the method trains the model on a set bootstrapped from X.
      **fit_kwargs: Keyword arguments to be passed to the fit method of the predictor.
  
  Returns:
      self
docstr_tok: ["Fits","self.estimator","to","the","given","data","and","labels",".","Args",":","X",":","The","new","samples","for","which","the","labels","are","supplied","by","the","expert",".","y",":","Labels","corresponding","to","the","new","instances","in","X.","bootstrap",":","If","True",",","the","method","trains","the","model","on","a","set","bootstrapped","from","X",".","*","*","fit_kwargs",":","Keyword","arguments","to","be","passed","to","the","fit","method","of","the","predictor",".","Returns",":","self"]
code: def _fit_on_new(
      self,
      X: modALinput,
      y: modALinput,
      bootstrap: bool = False,
      **fit_kwargs,
  ) -> "BaseLearner":
      """
      Fits self.estimator to the given data and labels.
  
      Args:
          X: The new samples for which the labels are supplied by the expert.
          y: Labels corresponding to the new instances in X.
          bootstrap: If True, the method trains the model on a set bootstrapped from X.
          **fit_kwargs: Keyword arguments to be passed to the fit method of the predictor.
  
      Returns:
          self
      """
  
      if not bootstrap:
          self.estimator.fit(X, y, **fit_kwargs)
      else:
          bootstrap_idx = np.random.choice(
              range(X.shape[0]), X.shape[0], replace=True
          )
          self.estimator.fit(X[bootstrap_idx], y[bootstrap_idx])
  
      return self
  
imports: import abc
  import sys
  import warnings
  from typing import Any, Callable, Iterator, List, Tuple, Union
  import numpy
  import scipy.sparse
  from modAL.utils.data import data_hstack, modALinput, retrieve_rows
  from sklearn.base import BaseEstimator
  from sklearn.ensemble._base import _BaseHeterogeneousEnsemble
  from sklearn.pipeline import Pipeline
label_desc: Use image node_id 3 for calling the BaseLearner obj's underlying member method code with example usage: obj._fit_on_new(X, y, bootstrap) and returns: self