# framech01/hybrid-music-recommender architecture

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

- Interactive diagram: https://gitdiagram.com/framech01/hybrid-music-recommender
- Repository: https://github.com/framech01/hybrid-music-recommender

## Overview

A script-based music recommendation pipeline: raw listening and track-feature data are explored and preprocessed, then used to produce ALS and content-based recommendations that are combined into user Top-10 results. The README documents time-based splits and leakage-safe cleaning; the sampled preprocessing excerpt confirms interaction aggregation and clean-data generation. The hybrid script consumes both model outputs. EDA is a separate analysis capability, not an input to recommendation execution.

Main entry points: [`preprocessing.py`](https://github.com/framech01/hybrid-music-recommender/blob/main/preprocessing.py) (Prepare datasets), [`Modeling_hybrid_filtering.py`](https://github.com/framech01/hybrid-music-recommender/blob/main/Modeling_hybrid_filtering.py) (Hybrid ranking), [`Modeling_model_based.py`](https://github.com/framech01/hybrid-music-recommender/blob/main/Modeling_model_based.py) (ALS recommender), [`Modeling_content_based.py`](https://github.com/framech01/hybrid-music-recommender/blob/main/Modeling_content_based.py) (Track similarity)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Data preparation"]
  node_preprocess["Prepare datasets<br/>[preprocessing.py]"]
  node_interactions["Play interactions<br/>[preprocessing.py]"]
  node_clean_splits["Clean time splits<br/>[preprocessing.py]"]
end

subgraph group_models["Recommendation models"]
  node_als["ALS recommender"]
  node_als_results["ALS Top-10"]
  node_content["Track similarity"]
  node_similar_tracks["Similar tracks"]
  node_hybrid["Hybrid ranking"]
  node_final_recs["Hybrid Top-10"]
end

subgraph group_analysis["Data analysis"]
  node_eda["Feature EDA"]
end

node_analyst(("Data analyst"))
node_music_data["Music dataset"]

node_music_data -->|"loads"| node_preprocess
node_preprocess -->|"aggregates"| node_interactions
node_preprocess -->|"cleans and saves"| node_clean_splits
node_interactions -->|"provides feedback"| node_als
node_als -->|"writes"| node_als_results
node_clean_splits -->|"provides features"| node_content
node_content -->|"writes"| node_similar_tracks
node_als_results -->|"loads"| node_hybrid
node_similar_tracks -->|"loads"| node_hybrid
node_hybrid -->|"writes"| node_final_recs
node_analyst -.->|"runs analysis"| node_eda
node_music_data -->|"analyzes"| node_eda

click node_preprocess "https://github.com/framech01/hybrid-music-recommender/blob/main/preprocessing.py"
click node_interactions "https://github.com/framech01/hybrid-music-recommender/blob/main/preprocessing.py"
click node_clean_splits "https://github.com/framech01/hybrid-music-recommender/blob/main/preprocessing.py"
click node_als "https://github.com/framech01/hybrid-music-recommender/blob/main/Modeling_model_based.py"
click node_als_results "https://github.com/framech01/hybrid-music-recommender/blob/main/Modeling_model_based.py"
click node_content "https://github.com/framech01/hybrid-music-recommender/blob/main/Modeling_content_based.py"
click node_similar_tracks "https://github.com/framech01/hybrid-music-recommender/blob/main/Modeling_content_based.py"
click node_hybrid "https://github.com/framech01/hybrid-music-recommender/blob/main/Modeling_hybrid_filtering.py"
click node_final_recs "https://github.com/framech01/hybrid-music-recommender/blob/main/Modeling_hybrid_filtering.py"
click node_eda "https://github.com/framech01/hybrid-music-recommender/blob/main/data_exploration.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_preprocess,node_interactions,node_clean_splits toneBlue
class node_als,node_als_results,node_content,node_similar_tracks,node_hybrid,node_final_recs toneAmber
class node_eda toneMint
class node_analyst,node_music_data toneIndigo
```

## Components

### Data preparation

- [Prepare datasets](https://github.com/framech01/hybrid-music-recommender/blob/main/preprocessing.py): `preprocessing.py`
- [Play interactions](https://github.com/framech01/hybrid-music-recommender/blob/main/preprocessing.py): `preprocessing.py`
- [Clean time splits](https://github.com/framech01/hybrid-music-recommender/blob/main/preprocessing.py): `preprocessing.py`

### Recommendation models

- [ALS recommender](https://github.com/framech01/hybrid-music-recommender/blob/main/Modeling_model_based.py): `Modeling_model_based.py`
- [ALS Top-10](https://github.com/framech01/hybrid-music-recommender/blob/main/Modeling_model_based.py): `Modeling_model_based.py`
- [Track similarity](https://github.com/framech01/hybrid-music-recommender/blob/main/Modeling_content_based.py): `Modeling_content_based.py`
- [Similar tracks](https://github.com/framech01/hybrid-music-recommender/blob/main/Modeling_content_based.py): `Modeling_content_based.py`
- [Hybrid ranking](https://github.com/framech01/hybrid-music-recommender/blob/main/Modeling_hybrid_filtering.py): `Modeling_hybrid_filtering.py`
- [Hybrid Top-10](https://github.com/framech01/hybrid-music-recommender/blob/main/Modeling_hybrid_filtering.py): `Modeling_hybrid_filtering.py`

### Data analysis

- [Feature EDA](https://github.com/framech01/hybrid-music-recommender/blob/main/data_exploration.py): `data_exploration.py`

### Other components

- **Data analyst**
- **Music dataset**

## Connections

- Music dataset → Prepare datasets: loads (evidence: `preprocessing.py`)
- Prepare datasets → Play interactions: aggregates (evidence: `preprocessing.py`)
- Prepare datasets → Clean time splits: cleans and saves (evidence: `preprocessing.py`)
- Play interactions → ALS recommender: provides feedback (evidence: `Modeling_model_based.py`)
- ALS recommender → ALS Top-10: writes (evidence: `Modeling_model_based.py`)
- Clean time splits → Track similarity: provides features (evidence: `README.md`)
- Track similarity → Similar tracks: writes (evidence: `Modeling_content_based.py`)
- ALS Top-10 → Hybrid ranking: loads (evidence: `Modeling_hybrid_filtering.py`)
- Similar tracks → Hybrid ranking: loads (evidence: `Modeling_hybrid_filtering.py`)
- Hybrid ranking → Hybrid Top-10: writes (evidence: `Modeling_hybrid_filtering.py`)
- Data analyst → Feature EDA: runs analysis (evidence: `data_exploration.py`)
- Music dataset → Feature EDA: analyzes (evidence: `data_exploration.py`)
