Skip to main content

robust-stats

Provides highly efficient implementations of various algorithm in robust statistics in Rust, with direct bindings to Python. The current focus is on robust mean estimation for known adversarial corruption for Gaussian distributions, but may later extend to robust covariance estimation or other useful robust statistical methods based on recent research efforts.

As far as this package is concerned, being robust means being able to compute the mean of a dataset where at most an $\epsilon$-fraction of the data is corrupted by an arbitrary adversary (can replace any set of the original sample with arbitrary other points, so long as it only affects an $\epsilon$-fraction of the input dataset).

Robust Mean Estimation

The robust_stats.robust_mean function computes the mean of an $n$-datapoint sample of a $d$-dimensional Gaussian dataset with identity covariance by default.

Usage

The robust_stats package can be installed via pip as follows:

pip install robust_stats

To compute the robust mean of a 2-dimensional numpy array with some $\epsilon$ sample corruption, then you can use the package as follows:

from robust_stats import robust_mean

x = get_data() # Returns some numpy array with dimension (n, d)
x_bar = robust_mean(x, 0.1, method='heuristic')

The arguments to robust_mean are as follows:

  1. x: np.ndarray - the $(n \times d)$ input array to compute the mean of.
  2. epsilon: float - the percent of the data that is thought to be corrupted, in $[0, 1]$.
  3. method: str = 'heuristic' - which robust mean estimation method to use. Must be one of the methods defined below. Defaults to heuristic.

It returns a $d$-dimensional output np.ndarray containing the computed mean value.

Methods

We provide efficient implementations of several means of robust mean estimation, based on relevant recent work in robust statistics. These methods

(heuristic)

Rust Source: src/robust/mean/robust_mean_heuristic.rs

(filter)

Rust Source: src/robust/mean/robust_mean_filter.rs

Projected Gradient Descent (pgd)

Rust Source: src/robust/mean/robust_mean_pgd.rs

Acknowledgements

This project was our final project for Brown's CSCI2952Q (Robust Algorithms in Machine Learning) taught by Professor Yu Cheng.

Maintainers

Metadata

Release files for robust-stats 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for robust-stats 0.1.1
File Size Uploaded Provenance Actions
robust_stats-0.1.1.tar.gz 29.8 kB Without provenance Details for robust_stats-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for robust-stats 0.1.1
File Interpreter ABI Platform Actions
robust_stats-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.34+ x86-64 Details for robust_stats-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl

Total release size: 1.8 MB

Release files / robust_stats-0.1.1.tar.gz

Download URL robust_stats-0.1.1.tar.gz
Size 29.8 kB
Tags Source
SHA-256 checksum
How to use checksums
00b6872ad3fb4824d3eada534cfe96dc89d58ab862e2385590962b70197edccd
BLAKE2b-256 checksum
How to use checksums
5b47163e4bd0eb5059e0713338c3e8d0de802009764392817db62cbf22ec8238
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.3.1

Release files / robust_stats-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl

Download URL robust_stats-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl
Size 1.8 MB
Tags CPython 3.11 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
1f72e5979979adce8377a8965fab98a2dc069af42d4be134de43d7f27d3e863d
BLAKE2b-256 checksum
How to use checksums
318ee722692742231e34354710cc4f25ba7829623c4e39f7c60923017f814d14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.3.1

Security for robust-stats 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page