Code Monkey home page Code Monkey logo

sparsepca's Introduction

Sparse PCA

Experimenting with Sparse PCA

Definition

The sparse PCA is define for a given matrix X in R^{n x p} and an integer k < p as the following optimization problem.

maximize v^TX^TXv such that ||v||_2 <= 1 and ||v||_0 <= k. (1)

We will denote A = X^TX in the following. This problem is NP-hard as one need to try all possible support of size smaller than k to solve it exactly. This is what is done with the brute_force_spca function.

Upper bound with DSPCA

The paper by d'Aspremont, Bach and El Ghaoui (2008) [1] propose a method to compute an upper bound of this value based on a convex relaxation of the problem (1). The convexe relaxation is here directly solved using cvxpy.

Sampling lower bound

By definition, the value of the k-SPCA can be lower bounded as the largest singular value of any sub mamatrix X_s composed by the columns of X from set s, as long as the cardinal of the set s is smaller than k. Thus, to compute an lower bound, it is possible to sample supports randomly and take the maximal singular value of all the generated supports.

Greedy lower bound

In their paper [2], Moghaddam, Weiss & Avidan propose to compute a greedy lower bound for the sparse PCA. Their algorithm, named GSPCA, inspect a subset of support constructed greedily. The support is initialized to I={} and then grown up to k elements by including in this set the coordinate yielding the best increase for the singular value of the submatrix A_I.

Comparison

These three bounds can be compare for small problems with the brute force approach. Here are the result for a random matrix of size 25 x 25 and rank 10.

image

sparsepca's People

Contributors

tommoral avatar

Stargazers

 avatar Xiaowei Song@GDIT avatar Yinchuan Cong avatar Anubhav avatar  avatar Zekun Zhang avatar Mainak Jas avatar GAO WEI avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.