Classification of a time series data
The method you have here is for time series, so input and output are a set of values over a time period.

The sum method sum(y) here is a short hand (abbreviation) for the average over the last mentioned equation, it is not a conventional sum.

Also do note argmax k over the sums is done in separate dimension for each k representing the individual class.

So in my understanding sum is needed only because it is a series of data and sum is calculated per class for the whole series.

The y target (n) is 1 in only in one dimension when match happen, so argmax k finds with highest value the correct class.