[mlpack-git] [mlpack] CF cannot properly handle 0s in the input matrix (#379)

Stephen Tu notifications at github.com
Tue Jan 13 21:02:49 EST 2015


A rudimentary implementation of a masked array is nothing more than a sparse matrix + a bitmask. The only operations we need are to be able to lookup if an i,j entry is present and iteration over the present values. we don't, for instance, need to multiply a masked array with a vector. 

I feel like your proposed additions to spmat complicate its implementation for very little additional gain; we seem to be the only use case. All the sparse matrix multiplication / factorization algorithms don't apply in the non-zero case, so you'll have to write two implementations of everything (the fast common case one + the slow non-zero one). If, on the other hand, you decide to not implement the majority of the algorithms for the non-zero case, then it's basically no different from a masked array with a default value. 

Honestly, I don't see what the big problem is with (uvec, vec) pair to specify matrix entries from an API perspective. Maybe all we need is a wrapper class

```
class MatrixEntries {
  arma::uvec indices;
  arma::vec values;
};
```

Of course, maybe there are some performance issues you are concerned with, which I have not thought about. Could you maybe elaborate more on why you think its important for the API to change in this regard?




---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/issues/379#issuecomment-69857664
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20150113/e95d6fdc/attachment-0001.html>


More information about the mlpack-git mailing list