Skip to main content

Robust principal component analysis for Python.

Project description

Robust principal component analysis for Python

This package provides algorithms to solve the Robust Principal Component Analysis (RPCA) problem, as presented by Candès et al.[1]. Currently, a single algorithm is implemented: it solves the Principal Component Pursuit (PCP) convex relaxation of RPCA from the same paper, using the Inexact Augmented Lagrange Multiplier (IALM) method from Lin et al.[2][3].

Example

from pyrpca import rpca_pcp_ialm

# given an m x n data matrix
data = ...

# decide on sparsity factor.
# this parameter is also commonly known as 'lambda'.
sparsity_factor = 1.0 / numpy.sqrt(max(data.shape))

# run the ialm algorithm.
low_rank, sparse = rpca_pcp_ialm(data, sparsity_factor)

Installing

pip install pyrpca

Feature requests and contributing

Pull requests and feature requests are welcome. The current version is minimal and suits my personal needs, but feel free to make suggestions. Even if the repository looks inactive, I will still respond :)

References

  1. Emmanuel J. Candès, Xiaodong Li, Yi Ma, John Wright. Robust principal component analysis? Association for Computing Machinery 2011. (preprint on arXiv)
  2. Zhouchen Lin, Risheng Liu, Zhixun Su. Linearized Alternating Direction Method with Adaptive Penalty for Low-Rank Representation. arXiv 2011.
  3. Zhouchen Lin, Minming Chen, Yi Ma. The Augmented Lagrange Multiplier Method for Exact Recovery of Corrupted Low-Rank Matrices, V3. arXiv 2013.

Acknowledgements

Appreciation is due to various other Python implementations of RPCA that served as inspiration for this project. Below is a non-exhaustive list:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyrpca-1.0.1-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file pyrpca-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyrpca-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyrpca-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 29a0edc6d9a608a649ac192194a7c93c5141a28678f480ccb601bf3415bf2f95
MD5 93f93ebd0631e53eb1a90572a7c236ba
BLAKE2b-256 4218d640394759392fd1f1707a7771c3f98edf6c7527c65e9f46bfcb1ff5796b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrpca-1.0.1-py3-none-any.whl:

Publisher: ci.yml on surgura/PyRPCA

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page