No project description provided
Project description
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:
x: np.ndarray
- the $(n \times d)$ input array to compute the mean of.epsilon: float
- the percent of the data that is thought to be corrupted, in $[0, 1]$.method: str = 'heuristic'
- which robust mean estimation method to use. Must be one of the methods defined below. Defaults toheuristic
.
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
- Robert Scheidegger (robert_scheidegger@brown.edu)
- Hammad Izhar (hammad_izhar@brown.edu)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for robust_stats-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f72e5979979adce8377a8965fab98a2dc069af42d4be134de43d7f27d3e863d |
|
MD5 | 406a0063d061c644d171f4df1fe97602 |
|
BLAKE2b-256 | 318ee722692742231e34354710cc4f25ba7829623c4e39f7c60923017f814d14 |