rusty_ai/lib.rs
1//! # Rusty-ai
2//!
3//! `rusty-ai` provides implementations of various classification and regression algorithms using Rust.
4//! It also contains some utility functions for data manipulation and metrics.
5//!
6//! ## Getting Started
7//!
8//! To use `rusty-ai`, add the following to your `Cargo.toml` file:
9//!
10//! ```toml
11//! [dependencies]
12//! rusty-ai = "*"
13//! ```
14//!
15//! ## Example Usage
16//!
17//! As a quick example, here's how you can use `rusty-ai` to train a gaussian naive bayes classifier on an example dataset:
18//!
19//! ```rust
20//!
21//! use rusty_ai::bayes::gaussian::*;
22//! use rusty_ai::data::dataset::*;
23//! use nalgebra::{DMatrix, DVector};
24//!
25//! let x = DMatrix::from_row_slice(4, 2, &[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]);
26//! let y = DVector::from_vec(vec![0, 0, 1, 1]);
27//!
28//! let dataset = Dataset::new(x, y);
29//!
30//! let mut model = GaussianNB::new();
31//!
32//! model.fit(&dataset).unwrap();
33//!
34//! let test_x = DMatrix::from_row_slice(2, 2, &[1.0, 2.0, 3.0, 4.0]);
35//!
36//! let predictions = model.predict(&test_x).unwrap();
37//! ```
38
39/// Naive Bayes Classifiers
40pub mod bayes;
41/// Dataset and data manipulation utilities
42pub mod data;
43/// Random Forests
44pub mod forests;
45/// Functions for evaluating model performance
46pub mod metrics;
47/// Regression analysis algorithms
48pub mod regression;
49/// Decision trees
50pub mod trees;