Skip to content

M-Ghosh9/Microsimulation-model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Microsimulation-model for Healthcare Policy

A C++ and Python-based application simulating the impact of healthcare policies on patient outcomes. This project leverages modern C++ (C++20/23) features and Python for predictive modeling and data visualization, providing stakeholders with actionable insights.

πŸ“š Project Overview

The microsimulation model evaluates the impact of healthcare policies, considering patient attributes such as age, gender, and risk factors. It uses:

  1. Modern C++ features like multithreading, vectorization, and smart pointers for fast, scalable simulations.
  2. Predictive modeling and dashboards to support data-driven policy-making decisions.

The model is designed for Windows 11 running on:

  1. CPU: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz.
  2. GPU: NVIDIA GeForce MX330.

πŸ› οΈ Features

  1. Scalable Simulations: Supports parallel processing and vectorization for large-scale simulations.
  2. Predictive Modeling: Models health risks based on patient attributes using Python ML tools.
  3. Interactive Visualizations: Dashboards for exploring health metrics, risk factors, and policy outcomes.
  4. Detailed Reporting: Generates patient-level data, population summaries, and policy impact metrics.
  5. Modular Design: Extensible C++ and Python architecture for easy enhancements.

Architecture Diagram

image

Class Diagram

image

Sequence Diagram

image

Use Case Diagram

image

Overall Synthetic Population Report:

Total population size: 100,000

Risk factor distribution:
diabetes        22786
hypertension    22907
obesity         23120
smoking         23085

Population Metrics Report:
Average Health Score: 81.70%
Proportion At Risk: 66.67%
Proportion with Diabetes: 24.88%
Proportion with Hypertension: 25.03%
Proportion with Obesity: 23.12%
Proportion with Smoking:  23.08%

risk factors

Classification Report:
                 precision  recall   f1-score   support

    diabetes       0.25      0.22      0.23      4579
hypertension       0.26      0.22      0.24      4571
     obesity       0.26      0.22      0.24      4725
     smoking       0.25      0.22      0.23      4500

classification

πŸ“Š Dashboard for Users

Dash is running on

http://127.0.0.1:8050/

πŸ“‚ Project Structure

microsimulation-model/
β”œβ”€β”€ CMakeLists.txt
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ architecture.png      # Architecture diagram
β”‚   β”œβ”€β”€ class_diagram.png     # Class diagram
β”‚   β”œβ”€β”€ sequence_diagram.png  # Sequence diagram
β”‚   β”œβ”€β”€ use_case_diagram.png  # Use Case diagram
β”‚   β”œβ”€β”€ output_diagram.png    # Output structure diagram
β”‚   └── usage_guide.md        # Detailed usage guide
β”œβ”€β”€ include/
β”‚   β”œβ”€β”€ *.h                   # Header files for core classes
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ *.cpp                 # Implementation of core classes
β”œβ”€β”€ python for visualization/
β”‚   β”œβ”€β”€ *.py                  # Python scripts for analysis and dashboards
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ *.cpp                 # Unit tests
β”‚   └── CMakeLists.txt
β”œβ”€β”€ data/
β”‚   └── patients_data.csv      # Synthetic patient data
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ run_simulation.sh      # Script to run simulations
β”‚   └── generate_report.sh     # Script to generate reports
└── images/
    β”œβ”€β”€ *.png                  # Diagrams and visualizations

πŸš€ Getting Started

πŸ“¦ Prerequisites

C++ Tools:
CMake (version 3.16+)
GCC, Clang, or MSVC compiler

Python Tools:
Python 3.8+
Libraries: numpy, pandas, matplotlib, seaborn, scikit-learn, dash

βš™οΈ Installation

  1. Clone the repository and build the project using CMake:
git clone https://github.com/M-Ghosh9/Microsimulation-model.git
cd Microsimulation-model
  1. Build the C++ application
mkdir build
cd build
cmake ..
make
  1. Install python dependencies
pip install -r requirements.txt

πŸƒβ€β™‚οΈ Running the Simulation

To run the simulation:

./microsimulation.exe

βœ… Running Tests

To run unit tests:

./tests/tests

πŸ“Š Generating Reports

Use the provided script to generate reports:

./scripts/generate_report.sh

Run the Dashboard

cd python\ for\ visualization/
python dashboard.py

Open the dashboard in your browser at

http://127.0.0.1:8050.

Visualization

  1. Health Score Distribution across the population healthscore distribution
  2. Prevalence of Diabetes across Age Group and Gender diabetes by age grp and gender
  3. Prevalence of Hypertension across Age Group and Gender hypertension by age grp and gender
  4. Prevalence of Obesity across Age Group and Gender obesity by age grp and gender
  5. Prevalence of Smoking across Age Group and Gender smoking by age grp and gender

Actions for Policymakers

Focus on high-risk groups (health scores <60). Promote interventions targeting prevalent risk factors.

About

A C++ application that simulates healthcare policy impacts on patient outcomes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages