dgl.data.chem.one_hot_encoding

dgl.data.chem.one_hot_encoding(x, allowable_set)[source]

One-hot encoding.

Parameters:
  • x (str, int or Chem.rdchem.HybridizationType) –
  • allowable_set (list) – The elements of the allowable_set should be of the same type as x.
Returns:

List of boolean values where at most one value is True. If the i-th value is True, then we must have x == allowable_set[i].

Return type:

list