# shlokye16/psycsmmi architecture

> Architecture diagram of the GitHub repository shlokye16/psycsmmi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shlokye16/psycsmmi
- Repository: https://github.com/shlokye16/psycsmmi

## Overview

PsycAI is a survey-based mental-health risk research project with a deployed Streamlit application. The user submits social-media usage and Likert responses; the app transforms responses into domain scores, runs a trained classifier, and presents a non-diagnostic result. The README also documents dataset analysis, model comparison, and model export. Those research stages are represented from documentation; their notebook internals were not sampled.

Main entry points: [`main.py`](https://github.com/shlokye16/psycsmmi/blob/main/main.py) (Survey interface), [`fn.py`](https://github.com/shlokye16/psycsmmi/blob/main/fn.py) (Inference preprocessing), [`experiment.ipynb`](https://github.com/shlokye16/psycsmmi/blob/main/experiment.ipynb) (Exploratory analysis), [`final.ipynb`](https://github.com/shlokye16/psycsmmi/blob/main/final.ipynb) (Model training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_research["Research and training"]
  node_dataset[("Survey dataset<br/>[dataset.csv]")]
  node_analysis["Exploratory analysis<br/>[experiment.ipynb]"]
  node_training["Model training<br/>[final.ipynb]"]
end

subgraph group_application["Survey application"]
  node_survey["Survey interface<br/>[main.py]"]
  node_result["Risk result<br/>[main.py]"]
end

subgraph group_inference["Inference pipeline"]
  node_model[("Trained classifier<br/>[model.pkl]")]
  node_preprocess["Inference preprocessing<br/>[fn.py]"]
  node_scoring["Weighted scoring<br/>[fn.py]"]
  node_aggregation["Domain aggregation<br/>[fn.py]"]
  node_prediction["Risk prediction<br/>[fn.py]"]
end

node_user(("Survey respondent"))

node_user -->|"submits responses"| node_survey
node_survey -->|"calls refine"| node_preprocess
node_preprocess -->|"applies scoring"| node_scoring
node_preprocess -->|"aggregates scores"| node_aggregation
node_survey -->|"calls predict"| node_prediction
node_prediction -->|"loads model"| node_model
node_survey -->|"displays outcome"| node_result
node_dataset -.->|"analyzed in"| node_analysis
node_analysis -.->|"informs modeling"| node_training
node_training -->|"exports classifier"| node_model

click node_dataset "https://github.com/shlokye16/psycsmmi/blob/main/dataset.csv"
click node_analysis "https://github.com/shlokye16/psycsmmi/blob/main/experiment.ipynb"
click node_training "https://github.com/shlokye16/psycsmmi/blob/main/final.ipynb"
click node_model "https://github.com/shlokye16/psycsmmi/blob/main/model.pkl"
click node_survey "https://github.com/shlokye16/psycsmmi/blob/main/main.py"
click node_preprocess "https://github.com/shlokye16/psycsmmi/blob/main/fn.py"
click node_scoring "https://github.com/shlokye16/psycsmmi/blob/main/fn.py"
click node_aggregation "https://github.com/shlokye16/psycsmmi/blob/main/fn.py"
click node_prediction "https://github.com/shlokye16/psycsmmi/blob/main/fn.py"
click node_result "https://github.com/shlokye16/psycsmmi/blob/main/main.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dataset,node_analysis,node_training toneBlue
class node_survey,node_result toneAmber
class node_model,node_preprocess,node_scoring,node_aggregation,node_prediction toneMint
class node_user toneIndigo
```

## Components

### Research and training

- [Survey dataset](https://github.com/shlokye16/psycsmmi/blob/main/dataset.csv): `dataset.csv`
- [Exploratory analysis](https://github.com/shlokye16/psycsmmi/blob/main/experiment.ipynb): `experiment.ipynb`
- [Model training](https://github.com/shlokye16/psycsmmi/blob/main/final.ipynb): `final.ipynb`

### Survey application

- [Survey interface](https://github.com/shlokye16/psycsmmi/blob/main/main.py): `main.py`
- [Risk result](https://github.com/shlokye16/psycsmmi/blob/main/main.py): `main.py`

### Inference pipeline

- [Trained classifier](https://github.com/shlokye16/psycsmmi/blob/main/model.pkl): `model.pkl`
- [Inference preprocessing](https://github.com/shlokye16/psycsmmi/blob/main/fn.py): `fn.py`
- [Weighted scoring](https://github.com/shlokye16/psycsmmi/blob/main/fn.py): `fn.py`
- [Domain aggregation](https://github.com/shlokye16/psycsmmi/blob/main/fn.py): `fn.py`
- [Risk prediction](https://github.com/shlokye16/psycsmmi/blob/main/fn.py): `fn.py`

### Other components

- **Survey respondent**

## Connections

- Survey respondent → Survey interface: submits responses (evidence: `main.py`)
- Survey interface → Inference preprocessing: calls refine (evidence: `main.py`)
- Inference preprocessing → Weighted scoring: applies scoring (evidence: `fn.py`)
- Inference preprocessing → Domain aggregation: aggregates scores (evidence: `fn.py`)
- Survey interface → Risk prediction: calls predict (evidence: `main.py`)
- Risk prediction → Trained classifier: loads model (evidence: `fn.py`)
- Survey interface → Risk result: displays outcome (evidence: `main.py`)
- Survey dataset → Exploratory analysis: analyzed in (evidence: `README.md`)
- Exploratory analysis → Model training: informs modeling (evidence: `README.md`)
- Model training → Trained classifier: exports classifier (evidence: `README.md`)
