dcase_util.data.OneHotEncoder.encode

OneHotEncoder.encode(label, length_frames=None, length_seconds=None)[source]

Generate one hot binary matrix

Parameters
labelstr

Class label to be hot

length_framesint

length of binary matrix in frames, use either this or length_seconds, if none set, one set in constructor is used. Default value None

length_secondsfloat

length of binary matrix in seconds, use either this or length_frames, if none set, one set in constructor is used. Default value None

Returns
self