Questions tagged [svd]

Singular Value Decomposition (SVD) is a factorization of a real or complex matrix, with many useful applications in signal processing and statistics.

The Singular Value Decomposition (SVD) of a rectangular matrix A is a decomposition of the form:

A = U S V*

where U and V are orthogonal matrices, and S is a diagonal matrix containing the singular values.

In scientific software for statistical computing, function svd computes this decomposition.

746 questions
5
votes
1 answer

R - Get a matrix with the reduced number of features with SVD

I'm using the SVD package with R and I'm able to reduce the dimensionality of my matrix by replacing the lowest singular values by 0. But when I recompose my matrix I still have the same number of features, I could not find how to effectively delete…
5
votes
1 answer

sign determination of singular vectors ind matlabs svd function

Does anybody know how the sign of the singular vectors resulting from Matlab's svd function is determined? Let: B = U*S*V' be a valid svd decomposition of a real or complex 2-by-2 matrix B, then: B = (U*c)*S *(V*c)' is also valid, where c is a…
user1618022
  • 163
  • 1
  • 6
5
votes
1 answer

PCA of RGB Image

I'm trying to figure out how to use PCA to decorrelate an RGB image in python. I'm using the code found in the O'Reilly Computer vision book: from PIL import Image from numpy import * def pca(X): # Principal Component Analysis # input: X,…
user3433572
  • 133
  • 2
  • 4
  • 11
5
votes
1 answer

SVD implementation map reduce

Hi I need to perform a Singular Value Decomposition on large dense square matrices using Map Reduce. I have already checked the Mahout project but what they provide is a TSQR…
5
votes
2 answers

Pagerank vs SVD

Pagerank works on the nodegraph of a series of pages and the directed edges formed by their respective inward and outward links. Thus the rank of a particular page is broadly a locally-induced effect in the nodegraph. SVD, on the other hand, works…
Phil H
  • 19,928
  • 7
  • 68
  • 105
5
votes
2 answers

Generalized Singular Value Decomposition & Sparse Matrices

I want to compute the Generalized Singular Value Decomposition (GSVD) for sparse matrices A and B. Therefore I am looking for an implementation that is capable of using a special data structure for sparse matrices. The only implementation I found…
Matthias Munz
  • 3,583
  • 4
  • 30
  • 47
5
votes
3 answers

Calculating SVD using multiple cores in R

I want to run svd() in R on a large sparse matrix (17k x 2m), and I have access to a cluster. Is there a straightforward way to calculate SVD in R using multiple cores? The RScaLAPACK package (http://www.inside-r.org/packages/cran/RScaLAPACK) would…
5
votes
2 answers

Using alternative LAPACK driver in numpy's svd method?

I'm using numpy.svd to compute singular value decompositions of badly conditioned matrices. For some special cases the svd won't converge and raise a Linalg.Error. I've done some research and found that numpy uses the DGESDD routine from LAPACK. The…
Mischa Obrecht
  • 2,737
  • 6
  • 21
  • 31
4
votes
2 answers

how to check whether the image is compressed or not after applying SVD on that image(regarding size of compressed image on disk)

I=imread('cameraman.tif'); figure(1),imshow(I) I1=im2double(I); [U,S,V]=svd(I1); figure(2),imshow(I1) for j=1:90 I2=U(:,1:j)*S(1:j,1:j)*V(:,1:j)'; end figure(3),imshow(I2) I3=U*S*V'; figure(4),imshow(I3) this is the code i have written for SVD…
Suj
  • 41
  • 2
4
votes
1 answer

SVD image reconstruction in Python

I am trying to do a Singular Value Decomposition of this image: taking the first 10 values. I have this code: from PIL import Image import numpy as np img = Image.open('bee.jpg') img = np.mean(img, 2) U,s,V = np.linalg.svd(img) recon_img = U @…
user12147936
4
votes
1 answer

Low rank approximation using scipy

I'm trying to use low-rank-approximation for latent semantic indexing. I thought that doing low rank approximation reduces matrix dimensions but it contradicts the results I get. Assume I have my dictionary with 40 000 words and 2000 documents. Then…
zemiret
  • 195
  • 1
  • 9
4
votes
1 answer

Getting negative S value from SVD decomposition in Numpy?

I want to whiten the CIFAR10 dataset using ZCA. The input X_train is of shape (40000, 32, 32, 3) where 40000 is the number of images, and 32x32x3 is the size of each image. I'm using the code from this answer for this purpose: X_flat =…
Soroush
  • 260
  • 2
  • 9
4
votes
2 answers

Basic Pseudocode for using SVD with Movielens/Netflix type data set

I'm struggling to figure out how exactly to begin using SVD with a MovieLens/Netflix type data set for rating predictions. I'd very much appreciate any simple samples in python/java, or basic pseudocode of the process involved. There are a number of…
oli
  • 3,541
  • 1
  • 27
  • 34
4
votes
1 answer

Calculating spinv with SVD

Background I'm working on a project involving solving large underdetermined systems of equations. My current algorithm calculates SVD (numpy.linalg.svd) of a matrix representing the given system, then uses its results to calculate the Moore-Penrose…
Rushabh Mehta
  • 1,529
  • 1
  • 13
  • 29
4
votes
3 answers

Number of components Trucated SVD

One can reduce dimensionality by using truncated SVD. It performs linear dimensionality reduction by means of truncated singular value decomposition (SVD). However, one has to choose the number of components before decomposing. n_comp =…
J. Doe
  • 3,458
  • 2
  • 24
  • 42