Files
foxhunt/ml/src/microstructure/ml_integration.rs
jgrusewski 987e5e6ac2 refactor(ml): remove 797 lines of commented-out code and disabled imports
Removed across 66 files:
- 49 instances of "// use crate::safe_operations; // DISABLED"
- 11 instances of "// use error_handling::{...}; // crate doesn't exist"
- 2 instances of "// use crate::Optimizer; // not available"
- 5 disabled test placeholder blocks (/* ... */) in ensemble/
- 1 disabled From impl in lib.rs (38 lines)
- 1 disabled test module in model.rs (113 lines)
- 1 disabled code block in integration/distillation.rs (41 lines)
- Various other disabled imports with explanation comments

All of this code references modules/crates that were removed during
prior refactoring waves and is preserved in git history. Removing it
reduces noise and makes the codebase easier to navigate.

1922 lib tests passing, compilation clean.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 19:43:47 +01:00

51 lines
1.8 KiB
Rust

//! # ML Microstructure Integration Module
//!
//! Orchestrates all advanced microstructure ML models for unified HFT alpha generation.
//! Provides a single interface for all models with ensemble prediction capabilities.
use std::collections::{HashMap, VecDeque};
use std::sync::Arc;
use std::sync::atomic::{AtomicU64, Ordering};
use std::time::Instant;
use candle_core::Device;
use candle_core::{Device, VarBuilder};
use serde::{Deserialize, Serialize};
use tokio::sync::{RwLock, Mutex};
use crate::{MLAppResult, InferenceResult, ModelMetadata};
use super::*;
use super::advanced_models::{
use super::advanced_models_extended::{
use super::{MarketDataUpdate, TradeDirection, MicrostructureResult};
#[tokio::test]
async fn test_ensemble_creation() {
let device = Device::Cpu;
let ensemble = MicrostructureMLEnsemble::new(device).await;
// Note: This will fail without proper model files, but tests the structure
assert!(ensemble.is_err()); // Expected without trained models
}
#[test]
fn test_ensemble_weights() {
let weights = EnsembleWeights::default();
let total_weight = weights.ofi_weight + weights.liquidity_weight +
weights.spread_weight + weights.impact_weight +
weights.toxicity_weight;
assert!((total_weight - 1.0).abs() < 0.01); // Should sum to approximately 1.0
}
#[test]
fn test_trading_action_determination() {
// Test various alpha/confidence combinations
let action_strong_buy = TradingAction::StrongBuy;
let action_hold = TradingAction::Hold;
// These would be tested with actual ensemble logic
assert!(matches!(action_strong_buy, TradingAction::StrongBuy));
assert!(matches!(action_hold, TradingAction::Hold));
}
}