class_docstr: Encodes any arbitrary string or molecule as a one-hot array.
  
  This featurizer encodes the characters within any given string as a one-hot
  array. It also works with RDKit molecules: it can convert RDKit molecules to
  SMILES strings and then one-hot encode the characters in said strings.
  
  Standalone Usage:
  
  >>> import deepchem as dc
  >>> featurizer = dc.feat.OneHotFeaturizer()
  >>> smiles = ['CCC']
  >>> encodings = featurizer.featurize(smiles)
  >>> type(encodings[0])
  <class 'numpy.ndarray'>
  >>> encodings[0].shape
  (100, 35)
  >>> featurizer.untransform(encodings[0])
  'CCC'
  
  Note
  ----
  This class needs RDKit to be installed in order to accept RDKit molecules as
  inputs.
  
  It does not need RDKit to be installed to work with arbitrary strings.
class_docstr_tok: ["Encodes","any","arbitrary","string","or","molecule","as","a","one-hot","array",".","This","featurizer","encodes","the","characters","within","any","given","string","as","a","one-hot","array",".","It","also","works","with","RDKit","molecules",":","it","can","convert","RDKit","molecules","to","SMILES","strings","and","then","one-hot","encode","the","characters","in","said","strings",".","Standalone","Usage",":",">",">",">","import","deepchem","as","dc",">",">",">","featurizer","=","dc.feat.OneHotFeaturizer","(",")",">",">",">","smiles","=","[","'CCC","'","]",">",">",">","encodings","=","featurizer.featurize","(","smiles",")",">",">",">","type","(","encodings","[","0","]",")","<","class","'numpy.ndarray","'",">",">",">",">","encodings","[","0","]",".shape","(","100",",","35",")",">",">",">","featurizer.untransform","(","encodings","[","0","]",")","'CCC'","Note","--","--","This","class","needs","RDKit","to","be","installed","in","order","to","accept","RDKit","molecules","as","inputs",".","It","does","not","need","RDKit","to","be","installed","to","work","with","arbitrary","strings","."]
code: def _featurize(self, datapoint: Any, **kwargs):
      # Featurize str data
      if isinstance(datapoint, (str, np.str_)):
          return self._featurize_string(datapoint)
      # Featurize mol data
      else:
          return self._featurize_mol(datapoint)
  
file_path: deepchem/deepchem/feat/molecule_featurizers/one_hot_featurizer.py
imports: import logging
  from typing import List
  import numpy
  from deepchem.utils.typing import RDKitMol
  from deepchem.utils.molecule_feature_utils import one_hot_encode
  from deepchem.feat.base_classes import Featurizer
  from typing import Any, Iterable, Optional
label_desc: Use image node_id 3 for calling the OneHotFeaturizer obj's underlying member method code with example usage: obj._featurize(datapoint) and returns: self, self