如何计算此训练模型的混淆矩阵?
model = Model([encoder_inputs, decoder_inputs], decoder_outputs)
model.compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=['accuracy'])
history = model.fit([encoder_input_data, decoder_input_data], decoder_target_data,
batch_size=batch_size,
epochs=epochs,
validation_split=0.2,
verbose=1)
model.summary()
答案 0 :(得分:0)
假设您有训练集和测试集且y_true
保持预期结果:
y_predicted
from sklearn.metrics import confusion_matrix
)confusion_matrix(y_true, y_predicted)