class_docstr: Test OneHotFeaturizer.
docstr: Test correct one hot encoding.
code: def test_correct_transformation_SMILES(self):
      """
      Test correct one hot encoding.
      """
      from rdkit import Chem
  
      charset = ["C", "N", "=", ")", "(", "O"]
      smiles = "CN=C=O"
      mol = Chem.MolFromSmiles(smiles)
      featurizer = OneHotFeaturizer(charset=charset, max_length=100)
      feature = featurizer([mol])
      assert np.allclose(feature[0][0], np.array([1, 0, 0, 0, 0, 0, 0]))
      assert np.allclose(feature[0][1], np.array([0, 1, 0, 0, 0, 0, 0]))
      assert np.allclose(feature[0][2], np.array([0, 0, 1, 0, 0, 0, 0]))
      assert np.allclose(feature[0][3], np.array([1, 0, 0, 0, 0, 0, 0]))
      assert np.allclose(feature[0][4], np.array([0, 0, 1, 0, 0, 0, 0]))
      assert np.allclose(feature[0][5], np.array([0, 0, 0, 0, 0, 1, 0]))
      # untranform
      undo_smiles = featurizer.untransform(feature[0])
      assert smiles == undo_smiles
  
file_path: deepchem/deepchem/feat/tests/test_one_hot_featurizer.py
imports: import unittest
  import numpy
  from deepchem.feat import OneHotFeaturizer
  from deepchem.feat.molecule_featurizers.one_hot_featurizer import ZINC_CHARSET
label_desc: Use image node_id 5 for calling the TestOneHotFeaturizer obj's underlying member method code with example usage: obj.test_correct_transformation_SMILES() without return types