This tutorial will walk you through your first EAGLE analysis, from installation to interpreting results.
Before starting, ensure you have:
- Python 3.8 or higher
- A CUDA-capable GPU (recommended but not required)
- At least 16GB of RAM
- Basic familiarity with Python and deep learning concepts
- Clone the repository:
git clone https://github.com/lab-rasool/EAGLE.git
cd EAGLE- Create a virtual environment (recommended):
python -m venv eagle_env
source eagle_env/bin/activate # On Windows: eagle_env\Scripts\activate- Install dependencies:
pip install -r requirements.txtLet's run a survival analysis on the GBM (Glioblastoma) dataset.
The simplest way to start is using the command line:
python main.py --dataset GBMThis command will:
- Load the GBM dataset with pre-computed embeddings
- Train the EAGLE model using 5-fold cross-validation
- Generate risk scores and stratify patients
- Create visualizations in the
results/directory
After the run completes, you'll find results in:
results/GBM/[timestamp]/
├── models/ # Trained model checkpoints
├── results/ # Risk scores and metrics
├── figures/ # Visualizations
└── run_info.txt # Configuration used
Key files to examine:
results/risk_scores.csv: Patient-level predictionsfigures/kaplan_meier_curves.png: Survival curves by risk grouprun_info.txt: Exact configuration for reproducibility
The console output will show:
=== Final Results ===
Mean C-index: 0.599 ± 0.062
The C-index (concordance index) measures how well the model ranks patients by risk:
- 0.5 = Random performance
- 0.7+ = Good performance
- 0.8+ = Excellent performance
To understand which data modalities drive predictions:
python main.py --dataset GBM --analyze-attributionThis adds:
- Modality contribution analysis
- Patient-level attribution
- Feature importance visualizations
New outputs in attribution/:
modality_contributions.png: Shows average importance of imaging vs clinical vs text datapatient_level_attribution.png: Individual patient analysistop_bottom_patients_analysis.csv: Detailed analysis of extreme cases
For more control, use the Python API:
from eagle import UnifiedPipeline, GBM_CONFIG, ModelConfig
# Custom model configuration
model_config = ModelConfig(
learning_rate=5e-5,
num_epochs=150,
dropout=0.35
)
# Create and run pipeline
pipeline = UnifiedPipeline(GBM_CONFIG, model_config)
results, risk_df, stats = pipeline.run(enable_attribution=True)
# Examine results
print(f"C-index: {results['mean_cindex']:.3f}")
print(f"\nRisk group distribution:")
print(risk_df['risk_group'].value_counts())
# High-risk patients
high_risk = risk_df[risk_df['risk_group'] == 'High']
print(f"\nHigh-risk patients: {len(high_risk)}")
print(f"Median survival: {high_risk['survival_time'].median():.1f} days")EAGLE includes traditional survival models for comparison:
# Run baseline models only
python main.py --mode baseline --dataset GBM
# Run both EAGLE and baselines
python main.py --mode all --dataset GBMThis generates comparative results showing EAGLE's performance against:
- Random Survival Forest (RSF)
- Cox Proportional Hazards (CoxPH)
- DeepSurv
- Start Simple: Use default settings first, then customize
- Monitor Training: Check the console output for training progress
- Examine Visualizations: The generated plots provide intuitive insights
- Use Attribution: Always enable attribution for clinical interpretability
- Save Results: The timestamp-based output ensures you never lose results
- Try different datasets (IPMN, NSCLC)
- Experiment with model configurations
- Read the Advanced Tutorial for custom datasets
- Explore the API Reference for detailed documentation
If you encounter problems:
- Ensure data files exist in the
data/directory - Check GPU memory if using large batch sizes
- Verify all dependencies are installed correctly
- See the Troubleshooting Guide
- Check the FAQ for common questions
- Open an issue on GitHub
- Review the example scripts in the repository
Congratulations! You've completed your first EAGLE analysis. The framework's power lies in its ability to combine multiple data types while maintaining interpretability - crucial for clinical applications.