Softmax regression cost function code
I really do not understand what does this code do
M = sparse.coo_matrix(([1]*n, (Y, range(n))), shape=(k,n)).toarray()
The code is related to calculating the sparse function in this equation, but I am really confused and I do not know how it iterates through it and what is:
1- sparse.coo_matrix
2- (Y, range(n)))
3-shape=(k,n)).toarray()
??
Also, What exactly does this term means in the equation and how to interpret it into code:
Thank you , and please forgive my poor English.
Topic sparse softmax multilabel-classification scipy machine-learning
Category Data Science