similar to: How to use "SparseM-conversions" to convert a dCgMatrix into a matrix.csr ?

Displaying 20 results from an estimated 2000 matches similar to: "How to use "SparseM-conversions" to convert a dCgMatrix into a matrix.csr ?"

2011 Oct 06
0
linear classifiers with sparse matrices
I've been trying to get some linear classifiers (LiblineaR, kernlab, e1071) to work with a sparse matrix of feature data. In the case of LiblineaR and kernlab, it seems I have to coerce my data into a dense matrix in order to train a model. I've done a number of searches, read through the manuals and vignettes, but I can't seem to see how to use either of these packages with sparse
2004 May 12
1
Problem installing SparseM on Debian stable
I have troubles installing the "SparseM" package on my Debian stable Linux system. Debian's version of R is: platform i386-pc-linux-gnu arch i386 os linux-gnu system i386, linux-gnu status major 1 minor 5.1 year 2002 month 06 day 17 language R This is the installation output: > R CMD INSTALL -l /usr/lib/R/ SparseM_0.36.tar.gz * Installing
2007 Jul 08
1
Problems with e1071 and SparseM
Hello all, I am trying to use the "svm" method provided by e1071 (Version: 1.5-16) together with a matrix provided by the SparseM package (Version: 0.73) but it fails with this message: > model <- svm(lm, lv, scale = TRUE, type = 'C-classification', kernel = 'linear') Error in t.default(x) : argument is not a matrix although lm was created before with
2012 Aug 24
2
SparseM buglet
read.matrix.csr does not close the connection: > library('SparseM') Package SparseM (0.96) loaded. > read.matrix.csr(foo) ... Warning message: closing unused connection 3 (foo) > -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://truepeace.org http://camera.org http://pmw.org.il http://think-israel.org
2009 Jun 25
0
[e1071] Inconsistent results when using matrix.csr for svm() - possibly scaling problem
Dear all, I'm training an SVM with default settings on a matrix csr (SparseM package). I realized that if I train the SVM with the (hopefully) equivalent matrix (Matrix package) representation, the returned models and predictions sometimes differ. I expected both representations of the same data to lead to the same results though. It could be that it is a scaling problem, because unscaled
2010 May 20
0
Indexing with sparse matrices (SparseM)
Hello, I'm working with a very large, very sparse X matrix. Let csr.X <- * as.matrix.csr*(X) as described by the SparseM package. The documentation says that "Indexing .... work just like they do on dense matrices". To me this says that I should be able to perform operations on the rows of csr.X in the same way I would on X itself. E.g. f <- function(x){ for (i in 1:n){
2009 Aug 14
1
large matrices in SparseM
Hi there, I'm having a problem when trying to create a large matrix (1,000,000 x 1,000,000) of the .csr type (package 'SparseM'). > k <- rep(0,1000000) > tmp <- length(k) > tmp2 <- as.matrix.csr(0,tmp,tmp) Error in if (length(x) == nrow * ncol) x <- matrix(x, nrow, ncol) else { : missing value where TRUE/FALSE needed Warning message: In nrow * ncol : NAs
2012 Apr 25
1
trouble installing SparseM
Dear R People: I am attempting to install SparseM on R 2.15.0 on a Linux 11.10 system. Here is the output > install.packages("SparseM",depen=TRUE) Installing package(s) into ?/home/erin/R/x86_64-pc-linux-gnu-library/2.15? (as ?lib? is unspecified) --- Please select a CRAN mirror for use in this session --- Loading Tcl/Tk interface ... done trying URL
2004 Jun 18
1
Initializing SparseM matrix matrix.csc
Hi! Would like to initialize a huge matrix.csc (Pacakge SparseM) with all elements 0 and afterwards set a few alements nonzero. The matrix which I like to allocate is so huge that I can not use A <- matrix(a,n1,p) before: A.csr <- as.matrix.csc(A) because I can not allocate such a huge matrix A. But I believe that the much more memmory efficient model in case of csc matrix should do it for
2010 Jan 11
2
sparseM and kronecker product_R latest version
Dear all, I just installed the new version of R, 2.10.1, and I am currently using the package sparseM. (I also use a 64 bit windows version) I got a problem that I never had: when I try to multiply with a kronecker product (%x%) two sparse matrixes I get the following message: Error in dim(x) <- length(x) : invalid first argument I never had this problem with previous versions of R. May
2004 Jun 25
2
Matrix: Help with syntax and comparison with SparseM
Hi, I am writing some basic smoothers in R for cleaning some spectral data. I wanted to see if I could get close to matlab for speed, so I was trying to compare SparseM with Matrix to see which could do the choleski decomposition the fastest. Here is the function using SparseM difsm <- function(y, lambda, d){ # Smoothing with a finite difference penalty # y: signal to be smoothed #
2009 Jan 20
1
Creating a Sparse Matrix from a Sparse Vector
Hello, I am working with a sparse matrix that is approx. 13,900 by 14,100. My goal is to select a row out of the matrix and create a new matrix with that row repeated 13,900 times without having to do any looping. Example: Starting Matrix: exampleMatrix 3 x 4 sparse Matrix of class "dgCMatrix" [1,] 1 . . . [2,] . 1 . 0.5 [3,] . . 1 .. New Matrix:.. newExampleMatrix 3 x 4 sparse
2007 Jan 30
1
SparseM and Stepwise Problem
I'm trying to use stepAIC on sparse matrices, and I need some help. The documentation for slm.fit suggests: slm.fit and slm.wfit call slm.fit.csr to do Cholesky decomposition and then backsolve to obtain the least squares estimated coefficients. These functions can be called directly if the user is willing to specify the design matrix in matrix.csr form. This is often advantageous in large
2003 May 27
1
setGeneric?
In the last few days I've received couple of messages pointing out that our SparseM package fails to install on the patched version of 1.7.0. Laurent Gaultier kindly suggested that replacing: setGeneric("as.matrix.csr") by setGeneric("as.matrix.csr", function(x, nrow, ncol, eps) standardGeneric("as.matrix.csr")) was sufficient to fix the problem.
2004 Nov 18
1
Method dispatch S3/S4 through optimize()
I have been running into difficulties with dispatching on an S4 class defined in the SparseM package, when the method calls are inside a function passed as the f= argument to optimize() in functions in the spdep package. The S4 methods are typically defined as: setMethod("det","matrix.csr", function(x, ...) det(chol(x))^2) that is within setMethod() rather than by name before
2016 Apr 20
0
Matrix: How create a _row-oriented_ sparse Matrix (=dgRMatrix)?
>>>>> Henrik Bengtsson <henrik.bengtsson at gmail.com> >>>>> on Tue, 19 Apr 2016 14:04:11 -0700 writes: > Using the Matrix package, how can I create a row-oriented sparse > Matrix from scratch populated with some data? By default a > column-oriented one is created and I'm aware of the note that the > package is optimized for
2004 Nov 26
1
Namespaces, coercion and setAs
I'm trying to resolve a small problem that has arisen from introducing a NAMESPACE for the package SparseM. Prior to the namespace I had a class "matrix.diag.csr" that consisted of diagonal sparse matrices. It was defined to have the same attributes as the matrix.csr class and setAs was used to define how to coerce integers and vectors into this form:
2017 Oct 21
0
What exactly is an dgCMatrix-class. There are so many attributes.
>>>>> C W <tmrsg11 at gmail.com> >>>>> on Fri, 20 Oct 2017 15:51:16 -0400 writes: > Thank you for your responses. I guess I don't feel > alone. I don't find the documentation go into any detail. > I also find it surprising that, >> object.size(train$data) > 1730904 bytes >>
2017 Oct 21
1
What exactly is an dgCMatrix-class. There are so many attributes.
> On Oct 21, 2017, at 7:50 AM, Martin Maechler <maechler at stat.math.ethz.ch> wrote: > >>>>>> C W <tmrsg11 at gmail.com> >>>>>> on Fri, 20 Oct 2017 15:51:16 -0400 writes: > >> Thank you for your responses. I guess I don't feel >> alone. I don't find the documentation go into any detail. > >> I also find
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"