All Projects → yixuan → RSpectra

yixuan / RSpectra

Licence: other
R Interface to the Spectra Library for Large Scale Eigenvalue and SVD Problems

Programming Languages

C++
36643 projects - #6 most used programming language
r
7636 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to RSpectra

Genericsvd.jl
Singular Value Decomposition for generic number types
Stars: ✭ 40 (-41.18%)
Mutual labels:  svd
Rsparse
Fast and accurate machine learning on sparse matrices - matrix factorizations, regression, classification, top-N recommendations.
Stars: ✭ 145 (+113.24%)
Mutual labels:  svd
Spectra.jl
Spectra.jl aims at helping treatment of spectral (Raman, Infrared, XAS, NMR) data under the Julia language
Stars: ✭ 18 (-73.53%)
Mutual labels:  spectra
Recommender
A recommendation system using tensorflow
Stars: ✭ 69 (+1.47%)
Mutual labels:  svd
Torch Batch Svd
A 100x faster SVD for PyTorch⚡️
Stars: ✭ 107 (+57.35%)
Mutual labels:  svd
ParadoxRs232toMqtt
esp8266, serial bus to mqtt for Paradox alarm systems
Stars: ✭ 66 (-2.94%)
Mutual labels:  spectra
Letterboxd recommendations
Scraping publicly-accessible Letterboxd data and creating a movie recommendation model with it that can generate recommendations when provided with a Letterboxd username
Stars: ✭ 23 (-66.18%)
Mutual labels:  svd
math105A
Numerical analysis course in Python
Stars: ✭ 20 (-70.59%)
Mutual labels:  svd
Pyreclab
pyRecLab is a library for quickly testing and prototyping of traditional recommender system methods, such as User KNN, Item KNN and FunkSVD Collaborative Filtering. It is developed and maintained by Gabriel Sepúlveda and Vicente Domínguez, advised by Prof. Denis Parra, all of them in Computer Science Department at PUC Chile, IA Lab and SocVis Lab.
Stars: ✭ 108 (+58.82%)
Mutual labels:  svd
astrodash
Deep learning for the automated spectral classification of supernovae
Stars: ✭ 25 (-63.24%)
Mutual labels:  spectra
Recommend
Python 3.6 下的推荐算法解析,尽量使用简单的语言剖析原理,相似度度量、协同过滤、矩阵分解等
Stars: ✭ 72 (+5.88%)
Mutual labels:  svd
Ristretto
Randomized Dimension Reduction Library
Stars: ✭ 92 (+35.29%)
Mutual labels:  svd
MetaMorpheus
Proteomics search software with integrated calibration, PTM discovery, bottom-up, top-down and LFQ capabilities
Stars: ✭ 59 (-13.24%)
Mutual labels:  spectra
Deeplearning Mxnet
MXNet for CTR
Stars: ✭ 51 (-25%)
Mutual labels:  svd
ALRA
Imputation method for scRNA-seq based on low-rank approximation
Stars: ✭ 48 (-29.41%)
Mutual labels:  svd
Ailearning
AiLearning: 机器学习 - MachineLearning - ML、深度学习 - DeepLearning - DL、自然语言处理 NLP
Stars: ✭ 32,316 (+47423.53%)
Mutual labels:  svd
impurityModel
Calculate many-body states of an impurity Anderson model and spectra (e.g. XPS, XAS, RIXS, NIXS)
Stars: ✭ 15 (-77.94%)
Mutual labels:  spectra
PageRank
A demonstration of the PageRank algorithm, using Eigenvectors to assign significance to HTML pages
Stars: ✭ 17 (-75%)
Mutual labels:  eigenvalues
tf-recsys
tf-recsys contains collaborative filtering (CF) model based on famous SVD and SVD++ algorithm. Both of them are implemented by tensorflow in order to utilize GPU acceleration.
Stars: ✭ 91 (+33.82%)
Mutual labels:  svd
awesome-spectra
🌈 A collaborative list of awesome tools for spectroscopy. Also, check:
Stars: ✭ 47 (-30.88%)
Mutual labels:  spectra

Solvers for Large Scale Eigenvalue and SVD Problems RSpectra

Introduction

RSpectra is an R interface to the Spectra library. It is typically used to compute a few eigenvalues/vectors of an n by n matrix, e.g., the k largest eigen values, which is usually more efficient than eigen() if k << n.

Currently this package provides the function eigs() for eigenvalue/eigenvector problems, and svds() for truncated SVD. Different matrix types in R, including sparse matrices, are supported. Below is a list of implemented ones:

  • matrix (defined in base R)
  • dgeMatrix (defined in Matrix package, for general matrices)
  • dgCMatrix (defined in Matrix package, for column oriented sparse matrices)
  • dgRMatrix (defined in Matrix package, for row oriented sparse matrices)
  • dsyMatrix (defined in Matrix package, for symmetric matrices)
  • dsCMatrix (defined in Matrix package, for symmetric column oriented sparse matrices)
  • dsRMatrix (defined in Matrix package, for symmetric row oriented sparse matrices)
  • function (implicitly specify the matrix by providing a function that calculates matrix product A %*% x)

Examples

We first generate some matrices:

library(Matrix)
n = 20
k = 5

set.seed(111)
A1 = matrix(rnorm(n^2), n)  ## class "matrix"
A2 = Matrix(A1)             ## class "dgeMatrix"

General matrices have complex eigenvalues:

eigs(A1, k)
eigs(A2, k, opts = list(retvec = FALSE))  ## eigenvalues only

RSpectra also works on sparse matrices:

A1[sample(n^2, n^2 / 2)] = 0
A3 = as(A1, "dgCMatrix")
A4 = as(A1, "dgRMatrix")

eigs(A3, k)
eigs(A4, k)

Function interface is also supported:

f = function(x, args)
{
    as.numeric(args %*% x)
}
eigs(f, k, n = n, args = A3)

Symmetric matrices have real eigenvalues.

A5 = crossprod(A1)
eigs_sym(A5, k)

To find the smallest (in absolute value) k eigenvalues of A5, we have two approaches:

eigs_sym(A5, k, which = "SM")
eigs_sym(A5, k, sigma = 0)

The results should be the same, but the latter method is far more stable on large matrices.

For SVD problems, you can specify the number of singular values (k), number of left singular vectors (nu) and number of right singular vectors(nv).

m = 100
n = 20
k = 5
set.seed(111)
A = matrix(rnorm(m * n), m)

svds(A, k)
svds(t(A), k, nu = 0, nv = 3)

Similar to eigs(), svds() supports sparse matrices:

A[sample(m * n, m * n / 2)] = 0
Asp1 = as(A, "dgCMatrix")
Asp2 = as(A, "dgRMatrix")

svds(Asp1, k)
svds(Asp2, k, nu = 0, nv = 0)

and function interface

f = function(x, args)
{
    as.numeric(args %*% x)
}
g = function(x, args)
{
    as.numeric(crossprod(args, x))
}
svds(f, k, Atrans = g, dim = c(m, n), args = Asp1)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].