fbreuer / analytic-feature-selection

Paper: Analytic Feature Selection for Support Vector Machines
0 stars 0 forks source link

questions about matrix rank implementation #3

Open fbreuer opened 11 years ago

fbreuer commented 11 years ago

Two questions about the implementation of matrix rank, i.e., my_matrix_rank:

  1. What does the argument values of my_matrix_rank mean?
  2. An alternative to using the SVD for computing the rank would be to use the QR decomposition. An advantage would be that numerical convergence is no longer an issue. How do SVD and QR compare performance-wise?
fbreuer commented 11 years ago

Part 2 may not be that relevant. Of course, all linear algebra functions have a numerical error, simply because we are dealing with floating point numbers here. (I am not that used to finite precision arithmetic ;) Still, I do wonder about the practical performance difference between SVD and QR.

stambizzle commented 11 years ago

Values is a list of the nonzero column indices. Basically it is just a way to keep track of when to stop the iterator. Any time I iterate over the columns, I send along values so that the loop can get set up as:

for i in xrange(0, len(values)):
fbreuer commented 11 years ago

Ah, okay. But is that information not stored in the matrix? That is, do we not have

len(values) == mat.shape[1]
stambizzle commented 11 years ago

It is! However, when I started writing the program, I didn't know about mat.shape. I devised my own way to get what I wanted, and stuck with it for consistency.

If I were going to start the program over, I would use mat.shape