Stuck on KNN book recommendations - what is a csr_matrix?

Been stuck on this challenge for like a week now.
Tried a couple of things to predict but I couldn’t even get it to work based on the fact that the model trains on values but is supposed to predict on a class.

So after briefly looking at solutions to get an idea - I saw people use a csr_matrix.
Can someone explain to my what it is and how it works?

A CSR is a compressed sparse row or compressed row storage matrix. It’s just a fancy way of storing only the non-zero entries in a matrix. In this case, I’d assume its somehow encoding the relationship between entities.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.