- Fix format_push_string: write!() instead of push_str(&format!()) (25 sites) - Fix str_to_string: .to_owned() instead of .to_string() on &str (6 sites) - Fix unseparated_literal_suffix: add _ separator (6 sites) - Fix multiple_inherent_impl: merge split impl blocks in TGGN, TFT, OFI (3) - Fix else_if_without_else: add exhaustive else clauses (3 sites) - Fix if_then_some_else_none: use .then().transpose() (1 site) - Fix unwrap_in_result: replace expect() with match + ? (2 sites) - Fix wildcard_enum_match_arm: enumerate Storage variants explicitly (2) - Fix decimal_literal_representation: use hex for power-of-2 constants (5) - Fix rc_buffer: Arc<Vec<T>> → Arc<[T]> for OFI features - Fix needless_range_loop: convert to iterator patterns (17 sites) - Fix used_underscore_binding: remove prefix on used vars (6 sites) - Fix doc list item indentation (7 sites) - Allow too_many_arguments on ML training functions (4) - Allow multiple_unsafe_ops_per_block on CUDA FFI functions (3) - Allow upper_case_acronyms on SLSTM/MLSTM model names (2) - Add ML-crate pedantic allows: shadow, similar_names, type_complexity, indexing_slicing, partial_pub_fields, non_ascii_literal, same_name_method (following existing ml-labeling/ml-universe pattern) Result: cargo clippy --workspace -- -D warnings passes with zero warnings. All 2758+ lib tests pass (2 pre-existing backtesting failures unchanged). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
71 lines
2.8 KiB
Rust
71 lines
2.8 KiB
Rust
//! Feature Engineering for Foxhunt ML models
|
|
//!
|
|
//! Core feature extractors: technical indicators, price patterns, volume analysis,
|
|
//! microstructure proxies, OFI (Order Flow Imbalance), normalization, and more.
|
|
|
|
#![allow(clippy::module_name_repetitions)]
|
|
#![allow(clippy::integer_division)]
|
|
#![deny(
|
|
clippy::unwrap_used,
|
|
clippy::expect_used,
|
|
clippy::panic
|
|
)]
|
|
#![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)] // Tensor/matrix indexing with bounds guaranteed by construction
|
|
#![allow(clippy::similar_names)] // ML naming: min_val/max_val, state/states are conventional
|
|
|
|
// Re-export core types at crate root for internal use
|
|
pub use ml_core::MLError;
|
|
pub use ml_core::types::OHLCVBar;
|
|
|
|
// Public modules (21 total)
|
|
pub mod adx_features;
|
|
pub mod alternative_bars;
|
|
pub mod bar_resampler;
|
|
pub mod barrier_optimization;
|
|
pub mod config;
|
|
pub mod ewma;
|
|
pub mod feature_extraction;
|
|
pub mod mbp10_loader;
|
|
pub mod microstructure;
|
|
pub mod microstructure_features;
|
|
pub mod normalization;
|
|
pub mod ofi_calculator;
|
|
pub mod pipeline;
|
|
pub mod position_features;
|
|
pub mod price_features;
|
|
pub mod regime_adx;
|
|
pub mod statistical_features;
|
|
pub mod time_features;
|
|
pub mod trades_loader;
|
|
pub mod types;
|
|
pub mod volume_features;
|
|
|
|
// Re-exports
|
|
pub use config::{FeatureConfig, FeatureGroup, FeatureIndices, FeaturePhase};
|
|
pub use alternative_bars::{
|
|
DollarBarSampler, ImbalanceBarSampler, RunBarSampler, TickBarSampler, VolumeBarSampler,
|
|
};
|
|
pub use barrier_optimization::{BarrierOptimizer, BarrierParams, OptimizationResult};
|
|
pub use ewma::{AdaptiveThreshold, EWMACalculator};
|
|
pub use price_features::PriceFeatureExtractor;
|
|
pub use volume_features::VolumeFeatureExtractor;
|
|
pub use adx_features::AdxFeatureExtractor;
|
|
pub use regime_adx::RegimeADXFeatures;
|
|
pub use microstructure_features::{
|
|
BuySellImbalance, HighLowSpread, InterArrivalTime, KyleLambda, MicrostructureFeature,
|
|
PriceImpact, TickCount, VarianceRatio, VolumeWeightedSpread,
|
|
};
|
|
pub use time_features::TimeFeatureExtractor;
|
|
pub use statistical_features::StatisticalFeatureExtractor;
|
|
pub use normalization::{FeatureNormalizer, NormalizationStats, RingBuffer};
|
|
pub use pipeline::{FeatureExtractionPipeline, PipelinePerformance};
|
|
pub use position_features::PositionFeatures;
|
|
pub use ofi_calculator::{OFICalculator, OFIFeatures};
|
|
pub use mbp10_loader::{get_recent_snapshots, get_snapshots_for_timestamp, load_mbp10_snapshots_sync};
|
|
pub use trades_loader::{get_trades_for_bar, load_trades_sync, DbnTrade};
|
|
pub use bar_resampler::BarResampler;
|