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//! - [`bayesian`]: Bayesian inference (conjugate priors, MCMC, variational inference)
48//! - [`glm`]: Generalized Linear Models (Poisson, Gamma, Binomial families)
49//! - [`decomposition`]: Matrix decomposition (ICA, PCA)
50//! - [`text`]: Text processing and NLP (tokenization, stop words, stemming)
51//! - [`time_series`]: Time series analysis and forecasting (ARIMA)
52//! - [`index`]: Approximate nearest neighbor search (HNSW)
53//! - [`recommend`]: Recommendation systems (content-based, collaborative filtering)
54//! - [`synthetic`]: Synthetic data generation for AutoML (EDA, back-translation, MixUp)
55//! - [`bundle`]: Model bundling and memory paging for large models
56//! - [`chaos`]: Chaos engineering configuration (from renacer)
57
58pub mod active_learning;
59pub mod autograd;
60pub mod automl;
61pub mod bayesian;
62pub mod bundle;
63pub mod calibration;
64pub mod chaos;
65/// Compiler-in-the-Loop Learning (CITL) for transpiler support.
66pub mod citl;
67pub mod classification;
68pub mod cluster;
69pub mod data;
70pub mod decomposition;
71pub mod ensemble;
72pub mod error;
73pub mod format;
74pub mod glm;
75pub mod gnn;
76pub mod graph;
77/// Hugging Face Hub integration (GH-100)
78#[cfg(feature = "hf-hub-integration")]
79pub mod hf_hub;
80pub mod index;
81pub mod interpret;
82pub mod linear_model;
83pub mod loss;
84pub mod metaheuristics;
85pub mod metrics;
86pub mod mining;
87pub mod model_selection;
88pub mod nn;
89pub mod optim;
90pub mod prelude;
91pub mod preprocessing;
92pub mod primitives;
93pub mod recommend;
94pub mod regularization;
95pub mod serialization;
96pub mod stats;
97pub mod synthetic;
98pub mod text;
99pub mod time_series;
100pub mod traits;
101pub mod transfer;
102pub mod tree;
103pub mod weak_supervision;
104
105pub use error::{AprenderError, Result};
106pub use primitives::{Matrix, Vector};
107pub use traits::{Estimator, Transformer, UnsupervisedEstimator};