# kai-zen23/elective-1 architecture

> Architecture diagram of the GitHub repository kai-zen23/elective-1, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kai-zen23/elective-1
- Repository: https://github.com/kai-zen23/elective-1

## Overview

This repository is a course-lab analysis of Spotify user behavior, not a streaming-platform implementation. The principal workflow explores a supplied dataset, prepares behavioral features, evaluates and fits K-Means, then visualizes and profiles the resulting user clusters. The notebook also proposes recommendation and UX adaptations based on those profiles; these are described as an application, not implemented integrations. The root README is a team portfolio. The analysis source is sampled only in part, so the graph omits uncertain internal wiring.

Main entry points: [`FirstLab_CS412/FirstLab_CS412.py`](https://github.com/kai-zen23/elective-1/blob/master/FirstLab_CS412/FirstLab_CS412.py) (Fit K-Means), [`FirstLab_CS412/spotify_user_behavior_realistic_50000_rows.xlsx`](https://github.com/kai-zen23/elective-1/blob/master/FirstLab_CS412/spotify_user_behavior_realistic_50000_rows.xlsx) (Spotify behavior data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Data Analysis"]
  node_dataset[("Spotify behavior data")]
  node_exploration["Explore data<br/>[FirstLab_CS412.py]"]
  node_preparation["Prepare features<br/>[FirstLab_CS412.py]"]
  node_selection["Choose cluster count<br/>[FirstLab_CS412.py]"]
end

subgraph group_results["Clustering Results"]
  node_clustering["Fit K-Means<br/>[FirstLab_CS412.py]"]
  node_visualization["Visualize clusters<br/>[FirstLab_CS412.py]"]
  node_profiling["Summarize user profiles<br/>[FirstLab_CS412.py]"]
end

subgraph group_application["Proposed Application"]
  node_adaptation["Recommendation and UX proposals<br/>[FirstLab_CS412.py]"]
end

node_analyst(("Lab analyst"))

node_analyst -->|"runs analysis"| node_exploration
node_dataset -->|"provides data"| node_exploration
node_exploration -->|"informs selection"| node_preparation
node_preparation -->|"evaluates K"| node_selection
node_selection -->|"sets K"| node_clustering
node_preparation -->|"provides features"| node_clustering
node_clustering -->|"projects clusters"| node_visualization
node_clustering -->|"summarizes groups"| node_profiling
node_profiling -.->|"motivates proposals"| node_adaptation

click node_dataset "https://github.com/kai-zen23/elective-1/blob/master/FirstLab_CS412/spotify_user_behavior_realistic_50000_rows.xlsx"
click node_exploration "https://github.com/kai-zen23/elective-1/blob/master/FirstLab_CS412/FirstLab_CS412.py"
click node_preparation "https://github.com/kai-zen23/elective-1/blob/master/FirstLab_CS412/FirstLab_CS412.py"
click node_selection "https://github.com/kai-zen23/elective-1/blob/master/FirstLab_CS412/FirstLab_CS412.py"
click node_clustering "https://github.com/kai-zen23/elective-1/blob/master/FirstLab_CS412/FirstLab_CS412.py"
click node_visualization "https://github.com/kai-zen23/elective-1/blob/master/FirstLab_CS412/FirstLab_CS412.py"
click node_profiling "https://github.com/kai-zen23/elective-1/blob/master/FirstLab_CS412/FirstLab_CS412.py"
click node_adaptation "https://github.com/kai-zen23/elective-1/blob/master/FirstLab_CS412/FirstLab_CS412.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_exploration,node_preparation,node_selection toneBlue
class node_clustering,node_visualization,node_profiling toneAmber
class node_adaptation toneMint
class node_analyst toneIndigo
```

## Components

### Data Analysis

- [Spotify behavior data](https://github.com/kai-zen23/elective-1/blob/master/FirstLab_CS412/spotify_user_behavior_realistic_50000_rows.xlsx): `FirstLab_CS412/spotify_user_behavior_realistic_50000_rows.xlsx`
- [Explore data](https://github.com/kai-zen23/elective-1/blob/master/FirstLab_CS412/FirstLab_CS412.py): `FirstLab_CS412/FirstLab_CS412.py`
- [Prepare features](https://github.com/kai-zen23/elective-1/blob/master/FirstLab_CS412/FirstLab_CS412.py): `FirstLab_CS412/FirstLab_CS412.py`
- [Choose cluster count](https://github.com/kai-zen23/elective-1/blob/master/FirstLab_CS412/FirstLab_CS412.py): `FirstLab_CS412/FirstLab_CS412.py`

### Clustering Results

- [Fit K-Means](https://github.com/kai-zen23/elective-1/blob/master/FirstLab_CS412/FirstLab_CS412.py): `FirstLab_CS412/FirstLab_CS412.py`
- [Visualize clusters](https://github.com/kai-zen23/elective-1/blob/master/FirstLab_CS412/FirstLab_CS412.py): `FirstLab_CS412/FirstLab_CS412.py`
- [Summarize user profiles](https://github.com/kai-zen23/elective-1/blob/master/FirstLab_CS412/FirstLab_CS412.py): `FirstLab_CS412/FirstLab_CS412.py`

### Proposed Application

- [Recommendation and UX proposals](https://github.com/kai-zen23/elective-1/blob/master/FirstLab_CS412/FirstLab_CS412.py): `FirstLab_CS412/FirstLab_CS412.py`

### Other components

- **Lab analyst**

## Connections

- Lab analyst → Explore data: runs analysis
- Spotify behavior data → Explore data: provides data
- Explore data → Prepare features: informs selection
- Prepare features → Choose cluster count: evaluates K
- Choose cluster count → Fit K-Means: sets K
- Prepare features → Fit K-Means: provides features
- Fit K-Means → Visualize clusters: projects clusters
- Fit K-Means → Summarize user profiles: summarizes groups
- Summarize user profiles → Recommendation and UX proposals: motivates proposals
