Wave 12 Group 3 Progress: ML Training Infrastructure Improvements ## Changes Summary ### Warning Fixes (W12-16B-WARNINGS: COMPLETE) - Fixed all actionable ML library warnings (0 warnings in ml/src/) - Fixed training example warnings (train_tft.rs, train_dqn.rs, train_ppo.rs, train_mamba2_dbn.rs) - Removed 900+ lines dead code (duplicate types, orphaned tests) - Enhanced metrics output with wall-clock timing Key fixes: - ml/examples/train_tft.rs: Changed 50→225 features, removed unused imports - ml/examples/train_tft_dbn.rs: Used training_duration and feature_config properly - ml/src/trainers/tft.rs: Fixed unused metadata, removed dead code methods - ml/src/dqn/: Deleted rainbow_types.rs (828 lines duplicate code) - ml/src/trainers/ppo.rs: Enhanced value pre-training metrics output ### Training Infrastructure - Added TFT Parquet support (ml/src/trainers/tft_parquet.rs) - Completed DQN training (30 epochs, 178 min) - Completed PPO training (30 epochs, production ready) - Completed MAMBA-2 retraining (20 epochs, best epoch 15) ### Test Data - Added 180-day Parquet files: ES.FUT, NQ.FUT, 6E.FUT, ZN.FUT - Added DBN validation examples - Added 225-feature validation examples ### Model Checkpoints - DQN: dqn_final_epoch30.safetensors (production ready) - PPO: ppo_actor/critic_epoch_30.safetensors (production ready) - MAMBA-2: best_model_epoch_15.safetensors (production ready) ## Remaining Work (W12-16B+) - Implement PPO Parquet support (4-6h) - Implement MAMBA-2 Parquet support (4-6h) - Wire gRPC orchestrator for Parquet training (2-3h) - Fix lazy loading implementation (8-12h) - Complete TFT training with 225 features 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
87 lines
3.3 KiB
Rust
87 lines
3.3 KiB
Rust
//! Convert NQ.FUT DBN file to Parquet format
|
|
//!
|
|
//! This example converts the Databento DBN file containing
|
|
//! NQ.FUT (E-mini NASDAQ 100 Futures) OHLCV data to Parquet format for ML training.
|
|
//!
|
|
//! Input: test_data/NQ_FUT_180d.dbn (4.10 MB, ~262,442 bars)
|
|
//! Output: test_data/NQ_FUT_180d.parquet
|
|
//!
|
|
//! Example usage:
|
|
//! ```bash
|
|
//! cargo run -p data --example convert_nq_fut_to_parquet --release
|
|
//! ```
|
|
|
|
use anyhow::Result;
|
|
use data::parquet_persistence::ParquetConfig;
|
|
use data::providers::databento::DbnToParquetConverter;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<()> {
|
|
// Initialize tracing for logging
|
|
tracing_subscriber::fmt()
|
|
.with_env_filter(
|
|
tracing_subscriber::EnvFilter::from_default_env()
|
|
.add_directive(tracing::Level::INFO.into()),
|
|
)
|
|
.init();
|
|
|
|
println!("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
|
|
println!(" DBN to Parquet Converter - NQ.FUT 180d OHLCV");
|
|
println!("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
|
|
println!();
|
|
|
|
// Configure Parquet output
|
|
let config = ParquetConfig {
|
|
base_path: "test_data".to_string(),
|
|
batch_size: 10000,
|
|
compression: parquet::basic::Compression::SNAPPY,
|
|
..Default::default()
|
|
};
|
|
|
|
println!("📁 Input: test_data/NQ_FUT_180d_uncompressed.dbn");
|
|
println!("📂 Output: test_data/NQ_FUT_180d.parquet");
|
|
println!();
|
|
|
|
// Create converter
|
|
let mut converter = DbnToParquetConverter::new(config).await?;
|
|
|
|
// Convert NQ.FUT file
|
|
println!("⚙️ Converting DBN to Parquet...");
|
|
let report = converter
|
|
.convert_file("test_data/NQ_FUT_180d_uncompressed.dbn")
|
|
.await?;
|
|
|
|
println!();
|
|
println!("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
|
|
println!(" Conversion Results");
|
|
println!("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
|
|
println!();
|
|
println!("✅ Events processed: {}", report.events_processed);
|
|
println!("⏭️ Events skipped: {}", report.events_skipped);
|
|
println!("❌ Events failed: {}", report.events_failed);
|
|
println!("📈 Success rate: {:.2}%", report.success_rate());
|
|
println!("⏱️ Duration: {:?}", report.duration);
|
|
println!(
|
|
"🚀 Throughput: {} events/sec",
|
|
report.throughput_events_per_sec
|
|
);
|
|
println!();
|
|
|
|
if report.is_success() {
|
|
println!("✅ SUCCESS! All events converted without errors.");
|
|
println!();
|
|
println!("📦 Output file ready for ML training:");
|
|
println!(" test_data/NQ_FUT_180d.parquet");
|
|
} else {
|
|
println!(
|
|
"⚠️ WARNING: Some events failed to convert ({} failures)",
|
|
report.events_failed
|
|
);
|
|
}
|
|
|
|
println!();
|
|
println!("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
|
|
|
|
Ok(())
|
|
}
|