For the sake of exemplification, let us consider the the time series convolutional neural network (CNN) classifier from the sktime
(this question can be applied for any ML model you want to):
from sktime.classification.deep_learning.cnn import CNNClassifier
cnn = CNNClassifier(n_epochs=Ne, batch_size=batch_size) # it runs for Ne epochs
cnn.fit(X_trn, y_trn)
where X_trn
and y_trn
is the training dataset and its label (i.e., a supervised learning). If the training dataset contains 60
instances and batch_size=4
, then the parameter vector of the CNN is iterated 60/4=15 times per epoch. In other words, for each mini-batch of 4 instances, the weights of the CNN is adjusted. Therefore, the accuracy of the CNN model is computer 15 times.
However, cnn.summary()["accuracy"]
is a list of Ne
accuracies (this length is independent from batch_size
), that is, only one accuracy per epoch. How those accuracies obtained in each mini-batch iteration are grouped in order to obtain the overall accuracy per epoch?