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
//! # blr-active: Active Learning Orchestration for Bayesian Linear Regression
//!
//! This crate provides active learning algorithms and orchestration logic for
//! iterative sensor calibration, built on top of the `blr-core` crate's BLR+ARD fitting.
//!
//! `blr-active` implements the 4-phase calibration workflow that drives a BLR+ARD model
//! from an initial rough fit to a precision-targeted, noise-aware calibration.
//!
//! ```text
//! blr-core (pure math: BLR+ARD, noise estimation, basis functions)
//! └── blr-active (this crate: active learning loop, precision tiers, sessions)
//! ```
//!
//! ## Architecture
//!
//! The 4-phase calibration workflow:
//!
//! ```text
//! Phase 0: Noise characterisation
//! NoiseCalibrationSession → estimate σ_noise → select PrecisionLevel
//! │
//! ▼
//! Phase 1: Exploration
//! CalibrationSession → collect initial data → fit BLR+ARD
//! │
//! ▼
//! Phase 2: Active learning
//! CalibrationSession::next_iteration() → recommend sample → user measures → add_measurement()
//! │ (repeat until precision goal is met or noise floor is hit)
//! ▼
//! Phase 3: Convergence / completion
//! CalibrationSession → export_history_json() → store results
//! ```
//!
//! ## Modules
//!
//! - [`active_learning`] — 5 active learning algorithms (variance, mutual info, goal-based, etc.)
//! - [`calibration_session`] — User-facing noise-aware precision targeting session ([`NoiseCalibrationSession`])
//! - [`goal_assessment`] — Feasibility classification for precision goals ([`assess_goal_feasibility`])
//! - [`precision_tiers`] — Precision tier definitions (Low/Moderate/High/Max) ([`PrecisionLevel`])
//! - [`error`] — [`ALError`] type with `From<BLRError>` bridge
//!
//! **Note:** Certificate metadata is in `sensor-calibration-component` (application layer).
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use blr_active::{NoiseCalibrationSession, CalibrationSession, SessionConfig};
//! use blr_core::noise_estimation::{NoiseEstimate, SensorType};
//!
//! // Phase 0: characterise sensor noise from initial measurements
//! let noise_est = NoiseEstimate {
//! point_estimate: 0.03,
//! lower_bound: 0.027,
//! upper_bound: 0.033,
//! confidence: "stable".to_string(),
//! };
//! let mut noise_session = NoiseCalibrationSession::new(SensorType::Hall, noise_est);
//!
//! // Inspect precision tiers to choose a goal
//! for tier in noise_session.precision_tiers.iter() {
//! println!("{:?}: target std = {:.4}", tier.level, tier.absolute_tolerance);
//! }
//!
//! // Phase 1-3: active learning loop
//! let config = SessionConfig::default();
//! let mut session = CalibrationSession::new(config, |x: f64| vec![1.0, x], 2);
//! // ... add measurements, call next_iteration(), check IterationOutcome
//! ```
//!
//! ## Feature Flags
//!
//! | Feature | Default | Description |
//! |---------|---------|-------------|
//! | `std` | ✓ | Enable standard library support (required for blr-core) |
//!
//! ## References
//!
//! - Settles, B. (2009). "Active Learning Literature Survey."
//! University of Wisconsin–Madison, Technical Report 1648.
//! - MacKay, D. J. C. (1992). "Information-Based Objective Functions for Active Data Selection."
//! *Neural Computation*, 4(4), 590–604.
pub use RecommendedSample;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;