Displaying 3 results from an estimated 3 matches for "nsparsematrix".
Did you mean:
sparsematrix
2015 Mar 19
0
RFC: Matrix package: Matrix products (%*%, crossprod, tcrossprod) involving "nsparseMatrix" aka sparse pattern matrices
Hi Martin
I got stung by this last week.
glmnet produces a coefficient matrix of class ?dgCMatrix?
If a predictor matrix was created using sparseMatrix as follows,
one gets unexpected results, as this simple example shows.
My fix was easy (I always convert the predictor matrix to class ?dgCMatrix? now)
Trevor
> y=Matrix(diag(4))
> y
4 x 4 diagonal matrix of class "ddiMatrix"
2015 Mar 20
0
RFC: Matrix package: Matrix products (%*%, crossprod, tcrossprod) involving "nsparseMatrix" aka sparse pattern matrices
Hi Martin,
package arules heavily relies on ngCMatrix and uses multiplication and
addition for logical operations. I think it makes sense that in a mixed
operation with one dgCMatrix and one ngCMatrix the ngCMatrix should be
"promoted" to a dgCMatrix.
The current behavior of %*% and friends is in deed confusing:
> m <- matrix(sample(c(0,1), 5*5, replace=TRUE), nrow=5)
>
2015 Mar 19
6
RFC: Matrix package: Matrix products (%*%, crossprod, tcrossprod) involving "nsparseMatrix" aka sparse pattern matrices
This is a Request For Comment, also BCCed to 390 package maintainers
of reverse dependencies of the Matrix package.
Most users and package authors working with our 'Matrix' package will
be using it for numerical computations, and so will be using
"dMatrix" (d : double precision) matrix objects M, and indirectly, e.g., for
M >= c will also use "lMatrix" (l: