Estimation Run
This example demonstrates how to use the LoS Estimator with real-world data. We will use a sample dataset containing ICU admissions and occupancy data.
A prepared script is provided in run_analysis.py that performs the estimation using the provided data.
Data Preparation
Using Preprocessed Data
The package includes preprocessed ICU data from Germany ready for analysis. The default_config.toml is already configured to use these files—no additional setup is required.
Updating with Fresh Data (Optional)
To use the latest data from the Robert Koch Institute (RKI):
Download the data:
The RKI maintains COVID-19 ICU data at the Intensivregister repository.
Place the CSV file:
Save the downloaded file to
los_estimator/data/preprocessing/inputsRun the preprocessing script:
python los_estimator/data/preprocessing/__init__.pyThis generates the required csv file.
Verify configuration:
Ensure
default_config.tomlpoints to the newly generated files.
Running the Analysis
Using the Analysis Script
Run the provided convenience script:
python run_analysis.py
Note: By default, less_windows is disabled in the script, allowing analysis of all windows. To perform a quick test with fewer windows, edit the script and set less_windows = True.
Using the Command Line
Alternatively, use the CLI directly:
python -m los_estimator --config_file los_estimator/default_config.toml
For full CLI documentation, see Command-Line Interface.
Understanding the Results
The analysis generates comprehensive output in the results/ directory. Each run creates a timestamped folder containing:
Performance metrics and comparison tables
Visualizations of fitted distributions and errors
Animations showing model evolution over time
Serialized data for post-processing
For a complete description of all output artifacts, see Output Format.
Reloading and Re-Visualization
Results can be reloaded without re-running the entire analysis:
from los_estimator.estimation_run import LosEstimationRun
# Load previous results
run = LosEstimationRun.load_run("results/<run_folder>")
# Generate new visualizations with updated settings
run.visualize_results()
run.animate_results()
This is useful for:
Adjusting figure sizes, colors, or styles
Creating publication-quality plots
Experimenting with different visualization layouts
Generating animations with different frame rates
Simply modify the visualization_config or animation_config in your configuration file before reloading.
Next Steps
Explore the Command-Line Interface for advanced configuration options
Review Output Format for detailed artifact documentation
Check the API for programmatic access to results