sparse-matrix Questions
7
Solved
I am using truncated SVD from scikit-learn package.
In the definition of SVD, an original matrix A is approxmated as a product A ≈ UΣV* where U and V have orthonormal columns, and Σ is non-negativ...
Machismo asked 20/7, 2015 at 18:18
3
/* The following codes are compiled into library(test.a) */
typedef struct {
short x[5];
} weight_t;
typedef struct {
weight_t wgt;
char *ptr;
} tbl_t;
/* huge static array and 70% of entries ...
Peeling asked 20/4, 2022 at 3:27
2
Solved
For a current project I have to compute the inner product of a lot of vectors with the same matrix (which is quite sparse). The vectors are associated with a two dimensional grid so I store the vec...
Chancemedley asked 19/9, 2013 at 18:5
2
I'm using sparse to construct, store, and read a large sparse matrix. I'd like to use Dask arrays to use its blocked algorithms features.
Here's a simplified version of what I'm trying to do:
fil...
Apfelstadt asked 20/2, 2019 at 14:15
1
I'm using Python Multiprocessing module to diagonalize a (large and sparse) matrix multiple times. I have to do this for a thousand times, so decided to do it in multiprocessing as I have 24 cores....
Agility asked 11/3, 2021 at 15:3
3
Solved
I am trying to create an identity matrix from a dataframe. The dataframe is like so:
i<-c("South Korea", "South Korea", "France", "France","France&q...
Lir asked 11/3, 2022 at 15:39
3
Solved
I have a sparse matrix
Formal class 'dgCMatrix' [package "Matrix"] with 6 slots
..@ i : int [1:37674] 1836 2297 108 472 1735 1899 2129 2131 5 67 ...
..@ p : int [1:3417] 0 2 8 22 25 35 44 45 45...
Matelote asked 19/8, 2012 at 19:7
2
Solved
I used the Java's API, i.e. Apache-Spark 1.2.0, and created two parse vectors as follows.
Vector v1 = Vectors.sparse(3, new int[]{0, 2}, new double[]{1.0, 3.0});
Vector v2 = Vectors.sparse(2, new ...
Cobelligerent asked 7/4, 2015 at 7:2
5
I am doing a text classification task with R, and I obtain a document-term matrix with size 22490 by 120,000 (only 4 million non-zero entries, less than 1% entries). Now I want to reduce the dimens...
Akers asked 23/5, 2012 at 10:51
2
Solved
I am working with a system that is using EF code first and I would like to use a number of SQL Server sparse columns on a table. My current solution is to drop the table created by EF and re-add vi...
Indium asked 12/4, 2012 at 12:54
3
For the base R matrix class we have the rowsum function, which is very fast for computing column sums across groups of rows.
Is there an equivalent function or approach implemented in the Matrix-p...
Entomo asked 25/6, 2018 at 14:33
2
Solved
I have built a small code that I want to use for solving eigenvalue problems involving large sparse matrices. It's working fine, all I want to do now is to set some elements in the sparse matrix to...
Inclinable asked 9/4, 2013 at 8:8
2
Solved
In Pandas, How can I check how sparse a DataFrame? Is there any function available, or I will need to write my own?
For now, I have this:
df = pd.DataFrame({'a':[1,0,1,1,3], 'b':[0,0,0,0,1], 'c':[4...
Tackett asked 21/9, 2020 at 5:5
3
I have a sparse matrix in R
I now wish to perform nonnegative matrix factorization on R
data.txt is a text file i created using python, it consists of 3 columns where first column specifies the row...
Kokura asked 21/4, 2012 at 1:11
2
Solved
I have a scipy.sparse.csr matrix and would like to dump it to a CSV file. Is there a way to preserve the sparsity of the matrix and write it to a CSV?
Gradualism asked 22/5, 2011 at 11:11
3
Using Scikit-learn (v 0.15.2) for non-negative matrix factorization on a large sparse matrix (less than 1% values > 0). I want to find factors by minimizing errors only on non-zero values of the ma...
Dunn asked 22/7, 2015 at 7:38
3
Solved
In my Python application, I find it handy to use a dictionary of dictionaries as the source data for constructing a sparse pandas DataFrame, which I then use to train a model in sklearn.
The struc...
Lyndonlyndsay asked 26/3, 2018 at 12:28
1
Solved
I am working with a 19089 x 9432 sparse Matrix of class "dgCMatrix" (let's call it M), and I have to extract each row to perform some calculations on it. I do this with a loop, so at each...
Addict asked 12/7, 2021 at 14:15
3
Graphs are very useful for modeling real-world phenomena and relationships.
Broadly, graph data structures and algorithms are divided into two categories:
Those useful for sparse graphs (e.g. adja...
Bedbug asked 12/12, 2014 at 5:2
3
Solved
Hi all I have a csv file which contains data as the format below
A a
A b
B f
B g
B e
B h
C d
C e
C f
The first column contains items second column contains available feature from feature vector=...
Oidium asked 20/7, 2015 at 14:19
1
I am trying to implement ALS algorithm in Dask, but I am having trouble figuring out how to compute latent feautures in one step. I followed formulas on this stackoverflow thread and come up with t...
Baines asked 22/5, 2021 at 14:56
3
Solved
I have been trying to divide a python scipy sparse matrix by a vector sum of its rows. Here is my code
sparse_mat = bsr_matrix((l_data, (l_row, l_col)), dtype=float)
sparse_mat = sparse_mat / (sp...
Spermine asked 14/2, 2017 at 11:42
5
Solved
I have a question about Eigen library in C++. Actually, I want to calculate inverse matrix of sparse matrix.
When I used Dense matrix in Eigen, I can use .inverse() operation to calculate inverse ...
Latterly asked 19/9, 2014 at 8:14
4
Solved
I am trying to figure out the fastest method to find the determinant of sparse symmetric and real matrices in python. using scipy sparse module but really surprised that there is no determinant fun...
Urian asked 1/10, 2013 at 3:48
6
Solved
scipy.sparse.coo_matrix.max returns the maximum value of each row or column, given an axis. I would like to know not the value, but the index of the maximum value of each row or column. I haven't f...
Effluvium asked 9/6, 2015 at 20:50
© 2022 - 2025 — McMap. All rights reserved.