sparse-matrix Questions
8
I am trying to run the following on Google Colab :
!pip install torch_sparse
At first, it seems to be working fine:
Collecting torch_sparse
Downloading https://files.pythonhosted.org/packages/9a/8...
Allium asked 27/4, 2021 at 14:30
5
I'm working with some rather large sparse matrices (from 5000x5000 to 20000x20000) and need to find an efficient way to concatenate matrices in a flexible way in order to construct a stochastic mat...
Banas asked 27/7, 2011 at 13:20
1
I'm working with IoT data from one source which send's tons of GB of sparse data from sensor readings. To make snapshots for analysis I try to export them to a small file and read it later as spars...
Mackintosh asked 31/3, 2020 at 17:18
3
Solved
I have a coo_matrix:
from scipy.sparse import coo_matrix
coo = coo_matrix((3, 4), dtype = "int8")
That I want converted to a pytorch sparse tensor. According to the documentation https://pytorch...
Misuse asked 3/6, 2018 at 9:54
7
Solved
There is also a counterpart which is called density array. What does this mean? I have done some search, but didn't get accurate information.
Rosati asked 4/8, 2011 at 6:39
3
Solved
I have a pytorch sparse tensor that I need sliced row/column wise using this slice [idx][:,idx] where idx is a list of indexes, using the mentioned slice yields my desired result on an ordinary flo...
Croy asked 3/6, 2018 at 12:30
7
In scipy, we can construct a sparse matrix using scipy.sparse.lil_matrix() etc. But the matrix is in 2d.
I am wondering if there is an existing data structure for sparse 3d matrix / array (tensor)...
Rice asked 7/10, 2011 at 9:8
5
Solved
I'm working turning a list of records with two columns (A and B) into a matrix representation. I have been using the pivot function within pandas, but the result ends up being fairly large. Does pa...
Ornery asked 27/7, 2015 at 19:26
2
According to MKL BLAS documentation
"All matrix-matrix operations (level 3) are threaded for both dense and sparse BLAS."
http://software.intel.com/en-us/articles/parallelism-in-the-intel-math-kern...
Countable asked 18/6, 2013 at 0:27
3
Solved
Given a sparse binary matrix A (csr, coo, whatever) I want to make a plot such that I can see the position (i,j) = white in the figure if A(i,j) = 1, and (i,j) = black if A(i,j) = 0;
For a dense n...
Severson asked 9/4, 2014 at 11:46
2
Solved
I have a very large sparse matrix of the type 'scipy.sparse.coo.coo_matrix'. I can convert to csr with .tocsr(), however .todense() will not work since the array is too large. I want to be able to ...
Engedus asked 8/8, 2016 at 18:27
1
The problem
I wish to solve a general system of linear equations A*x=b. The m-by-m matrix is sparse, real, square, somewhat poorly-conditioned, non-symmetric, but it is singular (rank(A)==m-1) bec...
Boelter asked 30/3, 2016 at 19:15
2
I have a dissimilarity matrix on which I would like to perform multidimensional scaling (MDS) using the sklearn.manifold.MDS function. The dissimilarity between some elements in this matrix is not ...
Scourings asked 21/4, 2017 at 11:15
4
Solved
I am using python scikit-learn for document clustering and I have a sparse matrix stored in a dict object:
For example:
doc_term_dict = { ('d1','t1'): 12, \
('d2','t3'): 10, \
('d3','t2'): 5 \
...
Tame asked 13/10, 2014 at 7:41
5
Solved
I have a Python list of row information for a sparse matrix. Each row is represented as a list of (column, value) tuples. Call it alist:
alist = [[(1,10), (3,-3)],
[(2,12)]]
How can I efficient...
Academic asked 25/4, 2017 at 19:4
7
Solved
Every once in a while, I get to manipulate a csr_matrix but I always forget how the parameters indices and indptr work together to build a sparse matrix.
I am looking for a clear and intuitive exp...
Esmond asked 12/9, 2018 at 16:7
1
I was following paper : Effective Latent Models for Binary Feedback in Recommender Systems by Maksims N. Volkovs and Guang Wei Yu.
It is for producing recommendation using model based approach, SVD...
Cullin asked 18/5, 2016 at 5:2
3
I'm wondering if there is a fast on-disk key-value storage with Python bindings which supports millions of read/write calls to separate keys. My problem involves counting word co-occurrences in a v...
Distinctly asked 2/4, 2020 at 7:43
2
Solved
I am wondering if there is any difference (advantage/disadvantage) of using .toarray() vs. .todense() on sparse NumPy arrays. E.g.,
import scipy as sp
import numpy as np
sparse_m = sp.sparse.bsr_ma...
Cryptogram asked 23/5, 2015 at 19:23
2
Solved
I don't know if it's possible, and it's possibly a naive question, but how can I set the equivalent of R's rownames() and colnames() to a scipy.sparse.csr.csr_matrix ?
I saw that my_matrix.dtype.n...
Sauceda asked 29/1, 2016 at 14:29
2
Solved
I am currently trying to speed up my large sparse (scipy) matrix multiplications. I have successfully linked my numpy installation with OpenBLAS and henceforth, also scipy. I have run these tests w...
Intermittent asked 2/8, 2014 at 19:32
6
Solved
I'd like to write a function that normalizes the rows of a large sparse matrix (such that they sum to one).
from pylab import *
import scipy.sparse as sp
def normalize(W):
z = W.sum(0)
z[z <...
Frankforter asked 6/9, 2012 at 17:6
2
Solved
This question has two parts (maybe one solution?):
Sample vectors from a sparse matrix: Is there an easy way to sample vectors from a sparse matrix?
When I'm trying to sample lines using random.sa...
Siren asked 24/3, 2012 at 21:48
5
Solved
I've got a collection of O(N) NxN scipy.sparse.csr_matrix, and each sparse matrix has on the order of N elements set. I want to add all these matrices together to get a regular NxN numpy array. (N ...
Nasal asked 28/6, 2012 at 23:22
5
With Python/Numpy, I'm working with n-dimensional data (ideally in a ndarray) such that:
(1): ragged array
For example A[0, :, :], ..., A[49, :, :] can be of shape 100x100, and A[50, :, :] could b...
Collative asked 23/6, 2022 at 16:11
1 Next >
© 2022 - 2025 — McMap. All rights reserved.