Compare commits

...

23 Commits

Author SHA1 Message Date
Palash Tyagi
3a6a4150a6
Merge cd3aa84e6019bad5492e9cbc6948caf6c0e0f726 into 27e9eab02829523c98744bdf9f7d780ebc352b48 2025-07-17 15:12:26 +01:00
27e9eab028
Merge pull request #58 from Magnus167/prep
Updating README
2025-07-17 00:16:23 +01:00
Palash Tyagi
c13fcc99f7 Remove commented-out dev-dependencies from Cargo.toml 2025-07-16 19:14:45 -04:00
Palash Tyagi
eb9de0a647 Fix typos and improve clarity in README documentation 2025-07-16 19:14:06 -04:00
Palash Tyagi
044c3284df Enhance README with detailed project scope, features, and compute module overview 2025-07-17 00:09:42 +01:00
Palash Tyagi
ad4cadd8fb Update version in Cargo.toml and enhance README for clarity and project scope 2025-07-16 23:51:42 +01:00
cd3aa84e60
Merge branch 'main' into csv 2025-07-06 11:35:13 +01:00
27275e2479
Merge branch 'main' into csv 2025-07-06 11:05:20 +01:00
9ef719316a
Merge branch 'main' into csv 2025-07-06 01:04:10 +01:00
960fd345c2
Merge branch 'main' into csv 2025-07-04 00:59:25 +01:00
325e75419c
Merge branch 'main' into csv 2025-06-07 13:38:30 +01:00
b1dc18d05b
Merge branch 'main' into csv 2025-05-15 18:35:46 +01:00
8cbb957764
Merge branch 'main' into csv 2025-05-13 00:08:38 +01:00
b937ed1cdf
Merge branch 'main' into csv 2025-05-11 02:00:25 +01:00
2e071a6974
Merge branch 'main' into csv 2025-05-05 02:13:15 +01:00
689169bab2
Merge branch 'main' into csv 2025-05-05 02:01:45 +01:00
a45a5ecf4e
Merge branch 'main' into csv 2025-05-04 02:29:12 +01:00
84e1b423f4
Merge branch 'main' into csv 2025-05-04 02:10:55 +01:00
197739bc2f
Merge branch 'main' into csv 2025-05-04 01:07:58 +01:00
d2c2ebca0f
Merge branch 'main' into csv 2025-05-03 01:32:05 +01:00
f5f3f2c100
Merge branch 'main' into csv 2025-05-02 23:38:37 +01:00
9fcb1ea2cf
Merge branch 'main' into csv 2025-05-01 01:14:09 +01:00
Palash Tyagi
623303cf72 Update README to include upcoming features for CSV I/O, Date Utils, and more math functions 2025-05-01 01:13:34 +01:00
2 changed files with 58 additions and 18 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "rustframe" name = "rustframe"
version = "0.0.1-a.0" version = "0.0.1-a.20250716"
edition = "2021" edition = "2021"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
readme = "README.md" readme = "README.md"
@ -19,9 +19,6 @@ rand = "^0.9.1"
[features] [features]
bench = ["dep:criterion"] bench = ["dep:criterion"]
# [dev-dependencies]
# criterion = { version = "0.5", features = ["html_reports"], optional = true }
[[bench]] [[bench]]
name = "benchmarks" name = "benchmarks"
harness = false harness = false

View File

@ -2,7 +2,7 @@
<!-- # <img align="center" alt="Rustframe" src=".github/rustframe_logo.png" height="50px" /> rustframe --> <!-- # <img align="center" alt="Rustframe" src=".github/rustframe_logo.png" height="50px" /> rustframe -->
<!-- though the centre tag doesn't work as it would noramlly, it achieves the desired effect --> <!-- though the centre tag doesn't work as it would normally, it achieves the desired effect -->
📚 [Docs](https://magnus167.github.io/rustframe/) | 🐙 [GitHub](https://github.com/Magnus167/rustframe) | 🌐 [Gitea mirror](https://gitea.nulltech.uk/Magnus167/rustframe) | 🦀 [Crates.io](https://crates.io/crates/rustframe) | 🔖 [docs.rs](https://docs.rs/rustframe/latest/rustframe/) 📚 [Docs](https://magnus167.github.io/rustframe/) | 🐙 [GitHub](https://github.com/Magnus167/rustframe) | 🌐 [Gitea mirror](https://gitea.nulltech.uk/Magnus167/rustframe) | 🦀 [Crates.io](https://crates.io/crates/rustframe) | 🔖 [docs.rs](https://docs.rs/rustframe/latest/rustframe/)
@ -15,27 +15,62 @@
## Rustframe: _A lightweight dataframe & math toolkit for Rust_ ## Rustframe: _A lightweight dataframe & math toolkit for Rust_
Rustframe provides intuitive dataframe, matrix, and series operations small-to-mid scale data analysis and manipulation. Rustframe provides intuitive dataframe, matrix, and series operations for data analysis and manipulation.
Rustframe keeps things simple, safe, and readable. It is handy for quick numeric experiments and small analytical tasks, but it is **not** meant to compete with powerhouse crates like `polars` or `ndarray`. Rustframe keeps things simple, safe, and readable. It is handy for quick numeric experiments and small analytical tasks as well as for educational purposes. It is designed to be easy to use and understand, with a clean API implemented in 100% safe Rust.
Rustframe is an educational project, and is not intended for production use. It is **not** meant to compete with powerhouse crates like `polars` or `ndarray`. It is a work in progress, and the API is subject to change. There are no guarantees of stability or performance, and it is not optimized for large datasets or high-performance computing.
### What it offers ### What it offers
- **Math that reads like math** - elementwise `+`, ``, `×`, `÷` on entire frames or scalars. - **Matrix operations** - Element-wise arithmetic, boolean logic, transpose, and more.
- **Broadcast & reduce** - sum, product, any/all across rows or columns without boilerplate. - **Math that reads like math** - element-wise `+`, ``, `×`, `÷` on entire frames or scalars.
- **Boolean masks made simple** - chain comparisons, combine with `&`/`|`, get a tidy `BoolMatrix` back. - **Frames** - Column major data structure for single-type data, with labeled columns and typed row indices.
- **Datecentric row index** - businessday ranges and calendar slicing built in. - **Compute module** - Implements various statistical computations and machine learning models.
- **Pure safe Rust** - 100% safe, zero `unsafe`.
- **[Coming Soon]** _DataFrame_ - Multi-type data structure for heterogeneous data, with labeled columns and typed row indices.
- **[Coming Soon]** _Random number utils_ - Random number generation utilities for statistical sampling and simulations. (Currently using the [`rand`](https://crates.io/crates/rand) crate.)
#### Matrix and Frame functionality
- **Matrix operations** - Element-wise arithmetic, boolean logic, transpose, and more.
- **Frame operations** - Column manipulation, sorting, and more.
#### Compute Module
The `compute` module provides implementations for various statistical computations and machine learning models.
**Statistics, Data Analysis, and Machine Learning:**
- Correlation analysis
- Descriptive statistics
- Distributions
- Inferential statistics
- Dense Neural Networks
- Gaussian Naive Bayes
- K-Means Clustering
- Linear Regression
- Logistic Regression
- Principal Component Analysis
### Coming soon
- **CSV I/O** - read/write CSV files with a simple API.
- **Date Utils** - date math, calendar slicing, indexing, and more.
- **More math** - more math functions and aggregations.
### Heads up ### Heads up
- **Not memoryefficient (yet)** - footprint needs work. - **Not memoryefficient (yet)** - footprint needs work.
- **Feature set still small** - expect missing pieces. - **The feature set is still limited** - expect missing pieces.
### On the horizon ### Somewhere down the line
- Optional GPU help (Vulkan or similar) for heavier workloads. - Optional GPU acceleration (Vulkan or similar) for heavier workloads.
- Straightforward Python bindings using `pyo3`. - Straightforward Python bindings using `pyo3`.
- Integration with common ML libraries, or introduce simple ML features.
--- ---
@ -51,7 +86,7 @@ use rustframe::{
let n_periods = 4; let n_periods = 4;
// Four business days starting 20240102 // Four business days starting 2024-01-02
let dates: Vec<NaiveDate> = let dates: Vec<NaiveDate> =
BDatesList::from_n_periods("2024-01-02".to_string(), DateFreq::Daily, n_periods) BDatesList::from_n_periods("2024-01-02".to_string(), DateFreq::Daily, n_periods)
.unwrap() .unwrap()
@ -86,13 +121,13 @@ let result: Matrix<f64> = result / 2.0; // divide by scalar
let check: bool = result.eq_elem(ma.clone()).all(); let check: bool = result.eq_elem(ma.clone()).all();
assert!(check); assert!(check);
// The above math can also be written as: // Alternatively:
let check: bool = (&(&(&(&ma + 1.0) - 1.0) * 2.0) / 2.0) let check: bool = (&(&(&(&ma + 1.0) - 1.0) * 2.0) / 2.0)
.eq_elem(ma.clone()) .eq_elem(ma.clone())
.all(); .all();
assert!(check); assert!(check);
// The above math can also be written as: // or even as:
let check: bool = ((((ma.clone() + 1.0) - 1.0) * 2.0) / 2.0) let check: bool = ((((ma.clone() + 1.0) - 1.0) * 2.0) / 2.0)
.eq_elem(ma.clone()) .eq_elem(ma.clone())
.all(); .all();
@ -163,3 +198,11 @@ E.g. to run the `game_of_life` example:
```bash ```bash
cargo run --example game_of_life cargo run --example game_of_life
``` ```
### Running benchmarks
To run the benchmarks, use:
```bash
cargo bench --features "bench"
```