aprender/lib.rs
1//! Aprender: Next-generation machine learning library in pure Rust.
2//!
3//! Aprender provides production-grade ML algorithms with a focus on
4//! ergonomic APIs, comprehensive testing, and backend-agnostic compute.
5//!
6//! # Quick Start
7//!
8//! ```
9//! use aprender::prelude::*;
10//!
11//! // Create training data (y = 2*x + 1)
12//! let x = Matrix::from_vec(4, 1, vec![
13//! 1.0,
14//! 2.0,
15//! 3.0,
16//! 4.0,
17//! ]).unwrap();
18//! let y = Vector::from_slice(&[3.0, 5.0, 7.0, 9.0]);
19//!
20//! // Train linear regression
21//! let mut model = LinearRegression::new();
22//! model.fit(&x, &y).unwrap();
23//!
24//! // Make predictions
25//! let predictions = model.predict(&x);
26//! let r2 = model.score(&x, &y);
27//! assert!(r2 > 0.99);
28//! ```
29//!
30//! # Modules
31//!
32//! - [`primitives`]: Core Vector and Matrix types
33//! - [`data`]: DataFrame for named columns
34//! - [`linear_model`]: Linear regression algorithms
35//! - [`cluster`]: Clustering algorithms (K-Means)
36//! - [`classification`]: Classification algorithms (Logistic Regression)
37//! - [`tree`]: Decision tree classifiers
38//! - [`metrics`]: Evaluation metrics
39//! - [`mining`]: Pattern mining algorithms (Apriori for association rules)
40//! - [`model_selection`]: Cross-validation and train/test splitting
41//! - [`preprocessing`]: Data transformers (scalers, encoders)
42//! - [`optim`]: Optimization algorithms (SGD, Adam)
43//! - [`loss`]: Loss functions for training (MSE, MAE, Huber)
44//! - [`serialization`]: Model serialization (SafeTensors format)
45//! - [`stats`]: Traditional descriptive statistics (quantiles, histograms)
46//! - [`graph`]: Graph construction and analysis (centrality, community detection)
47//! - [`chaos`]: Chaos engineering configuration (from renacer)
48
49pub mod chaos;
50pub mod classification;
51pub mod cluster;
52pub mod data;
53pub mod error;
54pub mod graph;
55pub mod linear_model;
56pub mod loss;
57pub mod metrics;
58pub mod mining;
59pub mod model_selection;
60pub mod optim;
61pub mod prelude;
62pub mod preprocessing;
63pub mod primitives;
64pub mod serialization;
65pub mod stats;
66pub mod traits;
67pub mod tree;
68
69pub use error::{AprenderError, Result};
70pub use primitives::{Matrix, Vector};
71pub use traits::{Estimator, Transformer, UnsupervisedEstimator};