I have a problem. I have trained a model and I would now calculate metrics for each epoch. How can I do this ? How can I access each individual epoch and calculate the metrics?
CALLBACKS = [tf.keras.callbacks.ModelCheckpoint(
filepath=Path(logpath, 'model_checkpoint-{epoch:02d}-{val_loss:.2f}.h5'),
verbose=1,
save_weights_only=False,
save_freq='epoch'), tensorboard]
loss = keras.losses.categorical_crossentropy
optim = keras.optimizers.Adam(learning_rate=0.0009)
metrics = ["accuracy"]
model.compile(loss=loss ,optimizer = optim, metrics=metrics)
history = model.fit(train_X, train_y, batch_size=32, epochs=10, validation_data=(test_X, test_y), callbacks=CALLBACKS)
What I want
precision recall f1-score support
0 0.45 0.45 0.45 1000
1 0.47 0.55 0.48 1000
... ... ... ... ...
98 0.55 0.65 0.78 1000
99 0.65 0.75 0.79 1000
accuarcy 0.83 100000
marco avg 0.83 0.83 0.83 100000
weghted avg 0.83 0.83 0.83 100000