采取one-hot编码的形式 allowable_set中为事先设定好的化学性质 def one_of_k_encoding(x, allowable_set): if x not in allowable_set: raise Exception("input {0} not in allowable set{1}:".format(x, allowable_set