Recall & Review
beginner
What is a sparse matrix?
A sparse matrix is a matrix mostly filled with zeros. It stores only the non-zero values and their positions to save memory.
Click to reveal answer
beginner
How do sparse matrices save memory compared to dense matrices?
Sparse matrices save memory by storing only non-zero elements and their locations instead of storing every element including zeros.
Click to reveal answer
intermediate
Name one common format used to store sparse matrices in SciPy.
One common format is CSR (Compressed Sparse Row), which stores non-zero values, column indices, and row pointers efficiently.
Click to reveal answer
beginner
Why is storing zeros in a large matrix inefficient?
Storing zeros wastes memory because zeros do not add information but still take space if stored explicitly.
Click to reveal answer
beginner
What kind of real-life data often benefits from sparse matrix storage?
Data like text documents (word counts), social networks (connections), and recommendation systems often have many zeros and benefit from sparse matrices.
Click to reveal answer
What does a sparse matrix store to save memory?
✗ Incorrect
Sparse matrices store only non-zero values and their positions to save memory.
Which SciPy format is commonly used for sparse matrices?
✗ Incorrect
CSR (Compressed Sparse Row) is a common format for sparse matrices in SciPy.
Why is storing zeros in a matrix inefficient?
✗ Incorrect
Zeros take up memory but do not add useful information, so storing them wastes space.
Which type of data is likely to be sparse?
✗ Incorrect
Text documents often have many zero counts for words, making them sparse.
What is the main benefit of using sparse matrices?
✗ Incorrect
Sparse matrices save memory by storing only non-zero elements.
Explain why sparse matrices save memory compared to dense matrices.
Think about what takes up space in a matrix.
You got /3 concepts.
Describe a real-life example where sparse matrices are useful and why.
Consider data with many empty or zero entries.
You got /4 concepts.