3:14 c=0 and c+=1
3:14 - the instructor did not mention the reason for c=0 or c+=1
It looks like a counter for the number of iterations of the loop, but why is it needed or what else is it used for (if any)
Hi Ryan!
Thanks for reaching out!
The variable c
is indeed a counter for the number of iterations of the loop. It is used to keep track of the current iteration while iterating through the classes. The primary purpose of this counter is not directly related to the calculation of the between-class scatter matrix S_b
, but rather it's used to enumerate the classes as you iterate through them.
c += 1
increments the counter c by 1 in each iteration. While it's not directly used in the calculation of S_b, it can help debug or keep track of which class you are currently processing.
Hope this helps.
Best,
Ivan