class_docstr: A pool-based active learner in which a pool holds all available unlabeled data.
  
  It uses a classifier, a query strategy and manages the mutually exclusive partition over the
  whole training data into labeled and unlabeled.
  
  Parameters
  ----------
  clf_factory : small_text.classifiers.factories.AbstractClassifierFactory
      A factory responsible for creating new classifier instances.
  query_strategy : small_text.query_strategies.QueryStrategy
      Query strategy which is responsible for selecting instances during a `query()` call.
  dataset : ~small_text.data.datasets.Dataset
      A training dataset that is supported by the underlying classifier.
  reuse_model : bool, default=False
      Reuses the previous model during retraining (if a previous model exists),
      otherwise creates a new model for each retraining.
  
  Attributes
  ----------
  indices_labeled : numpy.ndarray
      Indices of instances (relative to `self.x_train`) constituting the labeled pool.
  indices_ignored : numpy.ndarray or scipy.sparse.csr_matrix
      Indices of instances (relative to `self.x_train`) which have been ignored,
      i.e. which will never be returned by a query.
  y : numpy.ndarray or scipy.sparse.csr_matrix
      Labels for the the current labeled pool. Each tuple `(x_indices_labeled[i], y[i])`
      represents one labeled sample.
  indices_queried : numpy.ndarray or None
      Queried indices returned by the last `query()` call, or `None` if no query has been
      executed yet.
  fit_kwargs : dict
      Keyword arguments that will be passed to the `fit()` call during `update()`.
docstr: Performs an update step, which passes the label for each of the
  previously queried indices.
  
  An update step must be preceded by a query step. At the end of the update step the
  current model is retrained using all available labels.
  
  Parameters
  ----------
  y : numpy.ndarray or scipy.sparse.csr_matrix
      Labels provided in response to the previous query. Each label at index i corresponds
      to the sample x[i] for single-label data (ndarray) and each row of labels at index i
      corresponds to the sample x[i] for multi-label data (csr_matrix). Setting the label /
      row of labels to ` small_text.base import LABEL_IGNORED` will ignore the respective
      sample.
  indices_validation : numpy.ndarray, default=None
      The given indices (relative to `self.x_indices_labeled`) define a custom validation set
      if provided. Otherwise each classifier that uses a validation set will be responsible
      for creating a validation set.
docstr_tok: ["Performs","an","update","step",",","which","passes","the","label","for","each","of","the","previously","queried","indices",".","An","update","step","must","be","preceded","by","a","query","step",".","At","the","end","of","the","update","step","the","current","model","is","retrained","using","all","available","labels",".","Parameters","--","--","--","--","--","y",":","numpy.ndarray","or","scipy.sparse.csr_matrix","Labels","provided","in","response","to","the","previous","query",".","Each","label","at","index","i","corresponds","to","the","sample","x","[","i","]","for","single-label","data","(","ndarray",")","and","each","row","of","labels","at","index","i","corresponds","to","the","sample","x","[","i","]","for","multi-label","data","(","csr_matrix",")",".","Setting","the","label","\/","row","of","labels","to","`","small_text.base","import","LABEL_IGNORED","`","will","ignore","the","respective","sample",".","indices_validation",":","numpy.ndarray",",","default=None","The","given","indices","(","relative","to","`","self.x_indices_labeled","`",")","define","a","custom","validation","set","if","provided",".","Otherwise","each","classifier","that","uses","a","validation","set","will","be","responsible","for","creating","a","validation","set","."]
code: def update(self, y, indices_validation=None):
      """Performs an update step, which passes the label for each of the
      previously queried indices.
  
      An update step must be preceded by a query step. At the end of the update step the
      current model is retrained using all available labels.
  
      Parameters
      ----------
      y : numpy.ndarray or scipy.sparse.csr_matrix
          Labels provided in response to the previous query. Each label at index i corresponds
          to the sample x[i] for single-label data (ndarray) and each row of labels at index i
          corresponds to the sample x[i] for multi-label data (csr_matrix). Setting the label /
          row of labels to ` small_text.base import LABEL_IGNORED` will ignore the respective
          sample.
      indices_validation : numpy.ndarray, default=None
          The given indices (relative to `self.x_indices_labeled`) define a custom validation set
          if provided. Otherwise each classifier that uses a validation set will be responsible
          for creating a validation set.
      """
      if self.indices_queried.shape[0] != y.shape[0]:
          raise ValueError(
              "Query-update mismatch: indices queried - {} / labels provided - {}".format(
                  self.indices_queried.shape[0], y.shape[0]
              )
          )
  
      ignored = get_ignored_labels_mask(y, LABEL_IGNORED)
      if ignored.any():
          y = remove_by_index(y, np.arange(y.shape[0])[ignored])
          self.indices_ignored = np.concatenate(
              [self.indices_ignored, self.indices_queried[ignored]]
          )
  
      self.indices_labeled = np.concatenate(
          [self.indices_labeled, self.indices_queried[~ignored]]
      )
      self._index_to_position = self._build_index_to_position_dict()
  
      if (
          self.indices_labeled.shape[0]
          != np.unique(self.indices_labeled).shape[0]
      ):
          raise ValueError(
              "Duplicate indices detected in the labeled pool! "
              "Please re-examine your query strategy."
          )
  
      if not ignored.all():
          self.y = concatenate(self.y, y)
          self._retrain(indices_validation=indices_validation)
  
      self.indices_queried = None
      self.mask = None
  
imports: import numpy
  from abc import ABC, abstractmethod
  from pathlib import Path
  from scipy.sparse import csr_matrix
  from small_text.base import LABEL_IGNORED
  from small_text.exceptions import LearnerNotInitializedException
  from small_text.utils.data import list_length
  from small_text.utils.labels import concatenate, get_ignored_labels_mask, remove_by_index
  from small_text.version import __version__
label_desc: Use image node_id 4 for calling the PoolBasedActiveLearner obj's underlying member method code with example usage: obj.update(y, indices_validation) without return types