Bird
0
0

What will be the shape of U returned by svds when called as U, s, Vt = svds(A, k=2) if A is a 5x4 sparse matrix?

medium📝 Predict Output Q5 of 15
SciPy - Sparse Linear Algebra
What will be the shape of U returned by svds when called as U, s, Vt = svds(A, k=2) if A is a 5x4 sparse matrix?
A(2, 5)
B(2, 4)
C(4, 2)
D(5, 2)
Step-by-Step Solution
Solution:
  1. Step 1: Recall svds output shapes

    For an m x n matrix A, U has shape (m, k), s has length k, and Vt has shape (k, n).
  2. Step 2: Apply to given matrix

    Given A is 5x4 and k=2, U shape is (5, 2).
  3. Final Answer:

    (5, 2) -> Option D
  4. Quick Check:

    U shape = (rows of A, k) [OK]
Quick Trick: U shape = (rows of A, k) always [OK]
Common Mistakes:
  • Swapping dimensions of U
  • Confusing U with Vt shapes
  • Assuming U shape depends on columns

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes