#![deny(clippy::unwrap_used, clippy::expect_used)] #![cfg_attr(test, allow(clippy::unwrap_used, clippy::expect_used))] #![allow(clippy::module_name_repetitions)] #![allow(clippy::integer_division)] #![allow(clippy::shadow_reuse, clippy::shadow_same, clippy::shadow_unrelated)] // Tensor ops: let x = x.relu() is idiomatic #![allow(clippy::non_ascii_literal)] // Math symbols in ML documentation and error messages #![allow(clippy::partial_pub_fields)] // ML config structs: some fields are pub API, some internal #![allow(clippy::same_name_method)] // Intentional: inherent methods shadow trait defaults for ML-specific behavior #![allow(clippy::indexing_slicing)] // Validation code: bounds checked by construction #![allow(clippy::similar_names)] // ML naming: min_val/max_val, state/states are conventional //! # ML Data Validation //! //! Data quality validation, cross-validation, and statistical correction //! for Foxhunt ML training data. //! //! ## Modules //! //! - [`corrector`] -- Automatic correction of data quality issues //! - [`cpcv`] -- Combinatorial Purged Cross-Validation (Lopez de Prado) //! - [`fdr`] -- False Discovery Rate correction for multiple hypothesis testing //! - [`rules`] -- Composable validation rules for OHLCV data //! - [`validator`] -- Orchestrator that runs rules and generates reports pub mod corrector; pub mod cpcv; pub mod fdr; pub mod rules; pub mod validator; // Re-export core types used by this crate pub use ml_core::types::OHLCVBar; pub use ml_core::MLError; /// Technical indicators (10 essential ones). /// /// All indicators are calculated with standard parameters for 1-minute OHLCV data: /// - RSI(14): Relative Strength Index /// - MACD(12,26,9): Moving Average Convergence Divergence /// - Bollinger Bands(20, 2.0): Price envelope /// - ATR(14): Average True Range /// - EMA(12, 26): Exponential moving averages /// - Volume MA(20): Volume moving average /// /// This type mirrors `ml::data_loader::Indicators` so that the validation crate /// can operate independently of the full `ml` crate. Conversion between the two /// is trivial (both are plain `pub` field structs with identical layout). #[derive(Debug, Clone)] pub struct Indicators { /// RSI(14) - values 0-100 pub rsi: Vec, /// MACD line (12,26) pub macd: Vec, /// MACD signal line (9) pub macd_signal: Vec, /// Bollinger upper band (20, 2.0) pub bb_upper: Vec, /// Bollinger middle band (SMA 20) pub bb_middle: Vec, /// Bollinger lower band (20, 2.0) pub bb_lower: Vec, /// ATR(14) - volatility measure pub atr: Vec, /// EMA(12) - fast exponential moving average pub ema_fast: Vec, /// EMA(26) - slow exponential moving average pub ema_slow: Vec, /// Volume MA(20) - volume moving average pub volume_ma: Vec, } // Re-export main types pub use corrector::DataCorrector; pub use cpcv::{CPCVConfig, CPCVResult, CPCVSplit, CPCVValidator}; pub use fdr::{FDRConfig, FDRCorrector, FDRMethod, FDRResult}; pub use rules::{ CompletenessRule, ContinuityRule, IndicatorRule, IntegrityRule, TimestampRule, ValidationRule, }; pub use validator::{DataValidator, ValidationReport, ValidationResult};