Recall & Review
beginner
What does COO stand for in sparse matrix formats?
COO stands for Coordinate format. It stores a sparse matrix by listing the row and column coordinates of non-zero elements along with their values.
Click to reveal answer
beginner
How does COO format store data internally?
COO format stores three arrays: one for row indices, one for column indices, and one for the non-zero values. Each position in these arrays corresponds to one non-zero element.
Click to reveal answer
intermediate
Why is COO format useful for sparse matrices?
COO format is simple and efficient for constructing sparse matrices incrementally and for matrices with many non-zero elements scattered randomly.
Click to reveal answer
beginner
How do you create a COO sparse matrix using scipy?
Use scipy.sparse.coo_matrix with three arrays: data, (row indices, column indices), and optionally the shape of the matrix.
Click to reveal answer
intermediate
What is a limitation of COO format compared to CSR or CSC formats?
COO format is less efficient for arithmetic operations and matrix-vector products because it does not store data sorted by rows or columns.
Click to reveal answer
Which arrays are stored in COO format for a sparse matrix?
✗ Incorrect
COO format stores row indices, column indices, and the corresponding non-zero values.
What is the main advantage of COO format?
✗ Incorrect
COO format is simple and good for building sparse matrices incrementally.
Which scipy function creates a COO sparse matrix?
✗ Incorrect
The function scipy.sparse.coo_matrix creates a COO format sparse matrix.
What is a drawback of COO format compared to CSR?
✗ Incorrect
COO format is less efficient for arithmetic and matrix-vector operations than CSR.
In COO format, how are the non-zero elements stored?
✗ Incorrect
COO format stores non-zero elements in any order, with corresponding row and column indices.
Explain how COO format represents a sparse matrix and why it might be chosen over other formats.
Think about how you would list non-zero elements with their positions.
You got /5 concepts.
Describe the steps to create a COO sparse matrix using scipy and how to access its data.
Focus on the function and the arrays it needs.
You got /4 concepts.