# svarshneysjsu/predicting-internet-use-severity-in-child-with-actigraphy architecture

> Architecture diagram of the GitHub repository svarshneysjsu/predicting-internet-use-severity-in-child-with-actigraphy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/svarshneysjsu/predicting-internet-use-severity-in-child-with-actigraphy
- Repository: https://github.com/svarshneysjsu/predicting-internet-use-severity-in-child-with-actigraphy

## Overview

##### Project Type & Purpose
- Type: Machine-learning pipeline / data-science workflow for a Kaggle competition.
- Purpose: Ingest raw health-and-activity data, preprocess and engineer features, train multiple models (TabNet, LSTM, MLP, ensemble), evaluate, and submit predictions.

##### File Structure
- Top-level artifacts only:
- README.md – project overview, data sources, models, metrics
- cmi_prediction_using_VRandTabNet.ipynb – Jupyter notebook combining code for data prep, modeling, evaluation.
- Team8_Project_Report.pdf – final project report.
- No separate “src” or “scripts” directories, so treat the notebook as the single orchestration unit.

##### README for Key Components
- Data sources: Healthy Brain Network (tabular and time-series accelerometer).
- Stages: Preprocessing → EDA → Feature Engineering → Modeling → Evaluation → Submission.
- Models: TabNet, custom TabNet wrapper, LSTM variants, MLP, Voting Regressor ensemble.
- Tools / Frameworks: Python, Jupyter, PyTorch-TabNet, TensorFlow/Keras or PyTorch for LSTM, LightGBM / XGBoost / CatBoost, Borderline-SMOTE.

1. Data Sources
- Raw Tabular CSVs (demographics, usage, sleep)
- Raw Time-Series Accelerometer Logs
2. Data Ingestion & Storage
- File system or DataFrame loader
3. Data Preprocessing
- Missing-value handling, scaling, Borderline-SMOTE
4. Exploratory Data Analysis (EDA)
- Visualization modules (matplotlib / seaborn)
5. Feature Engineering
- Tabular features
- Time-series feature extraction (windowing, summary stats)
- Combined feature set
6. Modeling
- Branch A: TabNet Classifier / Custom Wrapper
- Branch B: Sequential models (LSTM, Siamese LSTM)
- Branch C: MLP on tabular features
7. Ensemble Module
- Voting Regressor combining LightGBM, XGBoost, CatBoost, TabNet
8. Evaluation & Metrics
- QWK calculation (train vs. validation)
- Kaggle submission file generator
9. Output & Reporting
- Submission CSV
- Visualizations saved to disk
- Team8_Project_Report.pdf

b. Relationships & Data Flow
Data Sources → Ingestion → Preprocessing → (EDA / Feature Eng.) → Modeling branches → Ensemble → Evaluation → Submission & Report

c. Architectural Patterns & Principles
- Pipeline pattern: sequential stages.
- Branch-and-merge pattern for parallel model training and ensemble.
- Modularity: separate preprocessing, feature engineering, modeling.

d. Key Technologies & Frameworks
- Python / Jupyter Notebook (orchestration)
- Pandas / NumPy for data prep
- Borderline-SMOTE (imbalanced-learn)
- PyTorch-TabNet for TabNet models
- TensorFlow/Keras or PyTorch for LSTM
- scikit-learn for MLP and voting regressor
- LightGBM, XGBoost, CatBoost for ensemble

##### Detailed Elements
- Data source origins (HBN dataset) with notes on data types.
- Preprocessing sub-steps (imputation, scaling, SMOTE).
- Parallel model branches and their frameworks.
- Ensemble combining logic and metrics computation.
- Final outputs: Kaggle submission and project report.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Project Overview
    PR["Project Overview & Component Descriptions\n(README.md)"]:::output
    PR-.->DS

    %% Data Pipeline
    DS["Data Sources\n(Raw Tabular & Time-Series Data)"]:::data
    DI["Data Ingestion & Storage\n(DataFrame Loaders)"]:::process
    DP["Data Preprocessing\n(Imputation, Scaling, Borderline-SMOTE)"]:::process
    EDA["Exploratory Data Analysis\n(Visualizations with matplotlib/seaborn)"]:::process
    FE["Feature Engineering\n(Tabular & Time-Series Windowing)"]:::process

    DS --> DI --> DP --> EDA --> FE

    %% Modeling Branches
    subgraph Modeling
        direction TB
        MN["TabNet Classifier\nCustom Wrapper"]:::model
        ML["LSTM Variants\nSequential & Siamese"]:::model
        MM["MLP on Tabular Features"]:::model
    end

    FE --> MN
    FE --> ML
    FE --> MM

    %% Ensemble and Evaluation
    E["Ensemble Module\n(Voting Regressor)"]:::ensemble
    EV["Evaluation & Metrics\n(QWK Calculation & Validation)"]:::ensemble

    MN --> E
    ML --> E
    MM --> E
    E --> EV

    %% Outputs
    SR["Submission CSV\n(Kaggle Export)"]:::output
    VI["Visualizations Saved to Disk"]:::output
    TR["Project Report\n(Team8_Project_Report.pdf)"]:::output

    EV --> SR
    EV --> VI
    EV --> TR

    %% Click Events
    click PR "https://github.com/svarshneysjsu/predicting-internet-use-severity-in-child-with-actigraphy/blob/main/README.md"
    click DS "https://github.com/svarshneysjsu/predicting-internet-use-severity-in-child-with-actigraphy/blob/main/cmi_prediction_using_VRandTabNet.ipynb"
    click DI "https://github.com/svarshneysjsu/predicting-internet-use-severity-in-child-with-actigraphy/blob/main/cmi_prediction_using_VRandTabNet.ipynb"
    click DP "https://github.com/svarshneysjsu/predicting-internet-use-severity-in-child-with-actigraphy/blob/main/cmi_prediction_using_VRandTabNet.ipynb"
    click EDA "https://github.com/svarshneysjsu/predicting-internet-use-severity-in-child-with-actigraphy/blob/main/cmi_prediction_using_VRandTabNet.ipynb"
    click FE "https://github.com/svarshneysjsu/predicting-internet-use-severity-in-child-with-actigraphy/blob/main/cmi_prediction_using_VRandTabNet.ipynb"
    click MN "https://github.com/svarshneysjsu/predicting-internet-use-severity-in-child-with-actigraphy/blob/main/cmi_prediction_using_VRandTabNet.ipynb"
    click ML "https://github.com/svarshneysjsu/predicting-internet-use-severity-in-child-with-actigraphy/blob/main/cmi_prediction_using_VRandTabNet.ipynb"
    click MM "https://github.com/svarshneysjsu/predicting-internet-use-severity-in-child-with-actigraphy/blob/main/cmi_prediction_using_VRandTabNet.ipynb"
    click E "https://github.com/svarshneysjsu/predicting-internet-use-severity-in-child-with-actigraphy/blob/main/cmi_prediction_using_VRandTabNet.ipynb"
    click EV "https://github.com/svarshneysjsu/predicting-internet-use-severity-in-child-with-actigraphy/blob/main/cmi_prediction_using_VRandTabNet.ipynb"
    click SR "https://github.com/svarshneysjsu/predicting-internet-use-severity-in-child-with-actigraphy/blob/main/cmi_prediction_using_VRandTabNet.ipynb"
    click TR "https://github.com/svarshneysjsu/predicting-internet-use-severity-in-child-with-actigraphy/blob/main/Team8_Project_Report.pdf"

    %% Styles
    classDef data fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef process fill:#90EE90,stroke:#333,stroke-width:1px
    classDef model fill:#FFA500,stroke:#333,stroke-width:1px
    classDef ensemble fill:#9370DB,stroke:#333,stroke-width:1px
    classDef output fill:#D3D3D3,stroke:#333,stroke-width:1px
```
