#machine-learning #regression #clustering #linear-regression

rusty_math

This is a Rust library for mathematical, statistical and machine learning operations

11 releases (6 breaking)

0.7.0 Sep 1, 2024
0.6.0 Aug 31, 2024
0.5.0 Aug 29, 2024
0.4.0 Aug 27, 2024
0.1.2 Aug 22, 2024

#249 in Math

Download history 291/week @ 2024-08-19 813/week @ 2024-08-26 46/week @ 2024-09-02

1,150 downloads per month

Custom license

130KB
1.5K SLoC

rusty_math

This is a Rust library for mathematical, statistical and machine learning operations.

Version 0.7.0

New version now supports K-Means clustering. See clustering module for more details.

Features

  • GCD
  • LCM
  • Factorial
  • Check if a number is prime
  • Find all primes numbers less than a number
  • Permutation
  • Combination
  • Integration
  • Differentiation
  • Solve a linear equation
  • Find roots of a polynomial using Falsi Reguli and Newton-Raphson methods
  • Linear Regression
  • Logistic Regression
  • Lasso and Ridge Regression
  • Logistic Regression
  • Naive Bayes Classifier
  • K-Nearest Neighbors
  • K-Means Clustering
  • R2 score
  • Mean squared error
  • Accuracy
  • Precision
  • Confusion Matrix
  • Recall
  • F1 score

Installation

To use rusty_math in your project, add the following to your Cargo.toml file:

[dependencies]
rusty_math = "0.7.0"

Modules

  1. numbers: Functions to find the GCD, LCM, factorial, to check for prime, to find all prime numbers less than n.
  2. calculus: Find the definite integral and slope of a function at a point.
  3. Linear: Fit and predict a several types linear functions.
  4. Equations: Solve a system of linear equations and find a root of polynomials using Falsi Reguli and Newton-Raphson methods
  5. naive_bayes: Fit a Gaussian Naive Bayes classifier and predict classes.
  6. knn: Fit and predict target values using K-nearest neighbors classification and regression models.
  7. clustering: Clustering Algorithms like KMeans.
  8. Metrics: Score machine learning models.

See detailed documation for list of functionalities in each module.

Usage

use rusty_math::gcd;

fn main() {
    let result = gcd(12, 15);
    println!("GCD of 12 and 15 is {}",result) ;
}

Contributing

Contributions are welcome! If you find any bugs or have suggestions for improvements, please open an issue or submit a pull request.

In case of any questions or feedback feel free to contact me at kjmakwana00@gmail.com

License

This project is licensed under the MIT License.

Dependencies

~735KB
~13K SLoC