// Convert to one-hot encoding
pre_behavioral_model_oh = np.empty((pre_behavioral_model.shape[0], 500, 50))
for i, a_list in enumerate(pre_behavioral_model):
pre_behavioral_model_oh[i] = to_categorical(a_list, num_classes=50)
//print(f"4 BM: {pre_behavioral_model_oh}")
return pre_behavioral_model_oh
def run(self):
After Change
//self.print(f"The sequence has shape {pre_behavioral_model.shape}")
// Reshape into (1, 500, 1) We need the first 1, because this is one sample only, but keras expects a 3d vector
pre_behavioral_model = np.reshape(pre_behavioral_model, (1, max_length, 1))
// self.print(f"Post Padded Seq sent: {pre_behavioral_model}. Shape: {pre_behavioral_model.shape}")
return pre_behavioral_model