Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/altunenes/asap-rs
Rust implementation of Automatic Smoothing for Attention Prioritization for Time Series
https://github.com/altunenes/asap-rs
algorithms data-normalization data-smoothing data-visualization dimension-reduction fft fourier-transform signal-processing smoothing time-series time-series-analysis
Last synced: about 14 hours ago
JSON representation
Rust implementation of Automatic Smoothing for Attention Prioritization for Time Series
- Host: GitHub
- URL: https://github.com/altunenes/asap-rs
- Owner: altunenes
- Created: 2024-09-04T20:12:45.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2024-09-10T10:09:29.000Z (4 months ago)
- Last Synced: 2025-01-13T02:39:03.313Z (5 days ago)
- Topics: algorithms, data-normalization, data-smoothing, data-visualization, dimension-reduction, fft, fourier-transform, signal-processing, smoothing, time-series, time-series-analysis
- Language: Rust
- Homepage:
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# asap-rs
[![crates.io](https://img.shields.io/crates/v/asap-rs.svg)](https://crates.io/crates/asap-rs)
![License](https://img.shields.io/badge/License-MIT-blue.svg)
[![Rust](https://github.com/altunenes/asap-rs/actions/workflows/rust.yml/badge.svg)](https://github.com/altunenes/asap-rs/actions/workflows/rust.yml)A Rust implementation of ASAP (Automatic Smoothing for Attention Prioritization), based on the paper "ASAP: Prioritizing Attention via Time Series Smoothing" learn more: [source paper & js code: ](https://github.com/stanford-futuredata/ASAP)
This project provides a high-performance Rust implementation of the ASAP algorithm for time series smoothing. It aims to efficiently reduce complexity in time series data while preserving significant trends, optimized for visualization purposes.
![asap](https://github.com/user-attachments/assets/e44b8e44-67b3-417a-a4f5-c8c08dfc1a41)
### Usage
```rust
use asap_rs::smooth;
fn main() {
// Example data
let data = [1.0, 3.2, 2.0, 3.0, 4.0, 5.0, 4.0, 3.0, 2.0, 1.0];
let resolution = 2;
let smoothed_data = smooth(&data, resolution);
}
```### Rust vs JS Performance
```diff
🦀 Rust: 1.4776ms
🟨 JS: 8.96ms
Data size: 500000
Smoothed size: 25
Original mean: 2499.97
Smoothed mean: 2499.97
```