class_docstr: Encodes any arbitrary string as a one-hot array.
  
  This featurizer uses the sklearn OneHotEncoder to create
  sparse matrix representation of a one-hot array of any string.
  It is expected to be used in large datasets that produces memory overload
  using standard featurizer such as OneHotFeaturizer. For example: SwissprotDataset
  
  
  Examples
  --------
  >>> import deepchem as dc
  >>> featurizer = dc.feat.SparseMatrixOneHotFeaturizer()
  >>> sequence = "MMMQLA"
  >>> encodings = featurizer.featurize([sequence])
  >>> encodings[0].shape
  (6, 25)
docstr: Featurize strings.
  
  Parameters
  ----------
  datapoints: list
      A list of either strings (str or numpy.str_)
  log_every_n: int, optional (default 1000)
      How many elements are featurized every time a featurization is logged.
code: def featurize(
      self, datapoints: Iterable[Any], log_every_n: int = 1000, **kwargs
  ) -> np.ndarray:
      """Featurize strings.
  
      Parameters
      ----------
      datapoints: list
          A list of either strings (str or numpy.str_)
      log_every_n: int, optional (default 1000)
          How many elements are featurized every time a featurization is logged.
  
      """
      # Featurize data using featurize() in parent class
      return Featurizer.featurize(self, datapoints, log_every_n)
  
file_path: deepchem/deepchem/feat/molecule_featurizers/sparse_matrix_one_hot_featurizer.py
imports: import logging
  from typing import List
  import numpy
  import scipy
  from deepchem.feat.base_classes import Featurizer
  from typing import Any, Iterable
label_desc: Use image node_id 2 for calling the SparseMatrixOneHotFeaturizer obj's underlying member method code with example usage: obj.featurize(datapoints, log_every_n) and returns: Featurizer