Home

Awesome

recursive-nystrom: Recursive Importance Sampling for the Nyström Method

MATLAB code implementing the recursive ridge leverage score sampling algorithm developed in: Recursive Sampling for the Nyström Method (NIPS 2017).

Installation

Download recursiveNystrom.m, add to MATLAB path, or include directly in project directory. For an example of usage see exampleApplication.m.

Usage

Input: recursiveNystrom(X,s,kernelFunc,accelerated_flag)

Output: Rank s Nyström approximation, in factored form.

C*W*C' approximates X's full kernel matrix, K.

In learning applications, it is natural to compute F = C*chol(W)'. F has n rows and s columns. Each row can be supplied as a data point to a linear algorithm (regression, SVM, etc.) to approximate the kernel version of the algorithm. Caveat: the accelerated version of our algorithm runs in O(ns) time. Computing F = C*chol(W)' takes O(ns<sup>2</sup>) time, so it may be more prudent to access the matrix implicitly.

Example

Compute a Nyström approximation for a Gaussian kernel matrix with variance parameter γ = 20

% generate random test matrix
X = randn(2000,100); X = normc(X);

% define function for computing kernel dot product
gamma = 20;
kFunc = @(X,rowInd,colInd) gaussianKernel(X,rowInd,colInd,gamma);

% compute factors of Nyström approximation
[C,W] = recursiveNystrom(X,500,kFunc);