1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
//! Aprender: Next-generation machine learning library in pure Rust.
//!
//! Aprender provides production-grade ML algorithms with a focus on
//! ergonomic APIs, comprehensive testing, and backend-agnostic compute.
//!
//! # Quick Start
//!
//! ```
//! use aprender::prelude::*;
//!
//! // Create training data (y = 2*x + 1)
//! let x = Matrix::from_vec(4, 1, vec![
//! 1.0,
//! 2.0,
//! 3.0,
//! 4.0,
//! ]).expect("valid matrix dimensions");
//! let y = Vector::from_slice(&[3.0, 5.0, 7.0, 9.0]);
//!
//! // Train linear regression
//! let mut model = LinearRegression::new();
//! model.fit(&x, &y).expect("linear regression fit should succeed");
//!
//! // Make predictions
//! let predictions = model.predict(&x);
//! let r2 = model.score(&x, &y);
//! assert!(r2 > 0.99);
//! ```
//!
//! # Modules
//!
//! - [`primitives`]: Core Vector and Matrix types
//! - [`data`]: `DataFrame` for named columns
//! - [`linear_model`]: Linear regression algorithms
//! - [`cluster`]: Clustering algorithms (K-Means)
//! - [`code`]: Code analysis and code2vec embeddings
//! - [`classification`]: Classification algorithms (Logistic Regression)
//! - [`tree`]: Decision tree classifiers
//! - [`metrics`]: Evaluation metrics
//! - [`mining`]: Pattern mining algorithms (Apriori for association rules)
//! - [`model_selection`]: Cross-validation and train/test splitting
//! - [`preprocessing`]: Data transformers (scalers, encoders)
//! - [`optim`]: Optimization algorithms (SGD, Adam)
//! - [`loss`]: Loss functions for training (MSE, MAE, Huber)
//! - [`serialization`]: Model serialization (`SafeTensors` format)
//! - [`stats`]: Traditional descriptive statistics (quantiles, histograms)
//! - [`graph`]: Graph construction and analysis (centrality, community detection)
//! - [`bayesian`]: Bayesian inference (conjugate priors, MCMC, variational inference)
//! - [`glm`]: Generalized Linear Models (Poisson, Gamma, Binomial families)
//! - [`decomposition`]: Matrix decomposition (ICA, PCA)
//! - [`text`]: Text processing and NLP (tokenization, stop words, stemming)
//! - [`time_series`]: Time series analysis and forecasting (ARIMA)
//! - [`index`]: Approximate nearest neighbor search (HNSW)
//! - [`recommend`]: Recommendation systems (content-based, collaborative filtering)
//! - [`synthetic`]: Synthetic data generation for `AutoML` (EDA, back-translation, `MixUp`)
//! - [`bundle`]: Model bundling and memory paging for large models
//! - [`cache`]: Cache hierarchy and model registry for large model management
//! - [`chaos`]: Chaos engineering configuration (from renacer)
//! - [`inspect`]: Model inspection tooling (header analysis, diff, quality scoring)
//! - [`loading`]: Model loading subsystem with WCET and cryptographic agility
//! - [`scoring`]: 100-point model quality scoring system
//! - [`zoo`]: Model zoo protocol for sharing and discovery
//! - [`embed`]: Data embedding with test data and tiny model representations
//! - [`native`]: SIMD-native model format for zero-copy inference
//! - [`stack`]: Sovereign AI Stack integration types
//! - [`online`]: Online learning and dynamic retraining infrastructure
// GH-41: unwrap() banned in production code via .clippy.toml.
// Tests use unwrap() freely — scoped allow for test builds only.
// Contract assertions from YAML (pv codegen)
/// Audio I/O and signal processing (mel spectrogram, resampling, capture)
/// Model evaluation and benchmarking framework (spec §7.10)
/// Benchmark visualization with rich colors and scientific statistics (PAR-040)
///
/// Creates 2×3 grid visualizations for inference comparisons with:
/// - ANSI terminal colors for clear pass/fail/warn status
/// - Multi-iteration statistics (mean, std dev, 95% CI)
/// - Criterion-style scientific benchmarking output
/// - Chat-pasteable profiling logs for debugging
/// Compiler-in-the-Loop Learning (CITL) for transpiler support.
/// Compute infrastructure integration (trueno 0.8.7+)
/// End-to-end demo infrastructure for Qwen2-0.5B WASM demo (spec §J)
/// Data embedding with test data and tiny model representations (spec §4)
/// Explainability wrappers for inference monitoring
/// Hugging Face Hub integration (GH-100)
/// Model inspection tooling (spec §7.2)
/// Model loading subsystem with WCET and cryptographic agility (spec §7.1)
/// TensorLogic: Neuro-symbolic reasoning via tensor operations (Domingos, 2025)
/// Pre-trained model architectures (Qwen2, etc.)
/// SIMD-native model format for zero-copy Trueno inference (spec §5)
/// Online learning and dynamic retraining infrastructure
/// Neural network pruning: importance scoring, sparsity masks, and compression.
/// Model Quality Assurance module (spec §7.9)
/// 100-point model quality scoring system (spec §7)
/// GPU Inference Showcase with PMAT verification (PAR-040)
///
/// Benchmark harness for Qwen2.5-Coder showcase demonstrating >2x performance:
/// - trueno GPU PTX generation (persistent kernels, megakernels)
/// - trueno SIMD (AVX2/AVX-512/NEON)
/// - trueno-zram KV cache compression
/// - renacer GPU kernel profiling
/// Speech processing: VAD, ASR, TTS, diarization (spec §5, GH-133)
/// Sovereign AI Stack integration types (spec §9)
/// Pipeline verification & visualization system (APR-VERIFY-001)
/// Voice processing: embeddings, style transfer, cloning (GH-132)
/// WASM/SIMD integration for browser-based inference (spec §L)
/// Model zoo protocol for sharing and discovery (spec §8)
pub use ;
pub use ;
pub use ;