# luispv05/music-patern-analysis architecture

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

- Interactive diagram: https://gitdiagram.com/luispv05/music-patern-analysis
- Repository: https://github.com/luispv05/music-patern-analysis

## Overview

This is a reproducible Spotify-track analysis project, not a hosted application. Its main workflow is to clean the Kaggle dataset into genre-level and unique-track datasets, then run exploratory, genre, clustering, and popularity analyses. The README documents these stages; sampled scripts confirm the cleaning outputs and clustering/popularity dependencies. Some EDA and genre-script internals were not sampled, so their specific data flows are not asserted.

Main entry points: [`src/preparacion.py`](https://github.com/luispv05/music-patern-analysis/blob/main/src/preparacion.py) (Feature preparation), [`data/raw`](https://github.com/luispv05/music-patern-analysis/tree/main/data/raw) (Raw dataset), [`data/processed`](https://github.com/luispv05/music-patern-analysis/tree/main/data/processed) (Processed datasets), [`src/limpieza.py`](https://github.com/luispv05/music-patern-analysis/blob/main/src/limpieza.py) (Cleaning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Data preparation"]
  node_raw[("Raw dataset")]
  node_clean["Cleaning<br/>[limpieza.py]"]
  node_processed[("Processed datasets")]
  node_anomalies["Anomaly counts"]
end

subgraph group_eda["Exploratory analysis"]
  node_overview["Dataset overview<br/>[eda_overview.py]"]
  node_quality["Data quality<br/>[eda_calidad.py]"]
  node_statistics["Descriptive statistics"]
  node_distributions["Feature distributions"]
  node_correlations["Feature correlations<br/>[eda_correlacion.py]"]
end

subgraph group_genres["Genre analysis"]
  node_genreprofiles["Genre profiles<br/>[generos_perfil.py]"]
  node_genreheatmap["Genre heatmap<br/>[generos_heatmap.py]"]
end

subgraph group_cluster["Clustering"]
  node_featureprep["Feature preparation<br/>[preparacion.py]"]
  node_pca["PCA analysis<br/>[clustering_pca.py]"]
  node_kselection["Cluster selection<br/>[clustering_k.py]"]
  node_clusterprofile["Cluster profiling"]
end

subgraph group_popularity["Popularity models"]
  node_popbase["Baseline models"]
  node_trees["Tree models"]
end

node_analyst(("Analyst"))

node_analyst -->|"runs"| node_clean
node_raw -->|"reads"| node_clean
node_clean -->|"writes datasets"| node_processed
node_analyst -.->|"may run"| node_anomalies
node_analyst -->|"runs"| node_overview
node_analyst -->|"runs"| node_quality
node_analyst -->|"runs"| node_statistics
node_analyst -->|"runs"| node_distributions
node_raw -->|"reads"| node_distributions
node_analyst -->|"runs"| node_correlations
node_raw -->|"reads"| node_correlations
node_analyst -->|"runs"| node_genreprofiles
node_analyst -->|"runs"| node_genreheatmap
node_processed -->|"reads"| node_genreheatmap
node_analyst -->|"runs"| node_featureprep
node_processed -->|"loads unique tracks"| node_featureprep
node_analyst -->|"runs"| node_pca
node_featureprep -->|"prepares features"| node_pca
node_analyst -->|"runs"| node_kselection
node_featureprep -->|"prepares features"| node_kselection
node_analyst -->|"runs"| node_clusterprofile
node_featureprep -->|"prepares features"| node_clusterprofile
node_analyst -->|"runs"| node_popbase
node_featureprep -->|"provides features"| node_popbase
node_analyst -->|"runs"| node_trees
node_popbase -->|"provides loader"| node_trees

click node_raw "https://github.com/luispv05/music-patern-analysis/tree/main/data/raw"
click node_clean "https://github.com/luispv05/music-patern-analysis/blob/main/src/limpieza.py"
click node_processed "https://github.com/luispv05/music-patern-analysis/tree/main/data/processed"
click node_anomalies "https://github.com/luispv05/music-patern-analysis/blob/main/src/limpieza_anomalias.py"
click node_overview "https://github.com/luispv05/music-patern-analysis/blob/main/src/eda_overview.py"
click node_quality "https://github.com/luispv05/music-patern-analysis/blob/main/src/eda_calidad.py"
click node_statistics "https://github.com/luispv05/music-patern-analysis/blob/main/src/eda_estadisticos.py"
click node_distributions "https://github.com/luispv05/music-patern-analysis/blob/main/src/eda_distribuciones.py"
click node_correlations "https://github.com/luispv05/music-patern-analysis/blob/main/src/eda_correlacion.py"
click node_genreprofiles "https://github.com/luispv05/music-patern-analysis/blob/main/src/generos_perfil.py"
click node_genreheatmap "https://github.com/luispv05/music-patern-analysis/blob/main/src/generos_heatmap.py"
click node_featureprep "https://github.com/luispv05/music-patern-analysis/blob/main/src/preparacion.py"
click node_pca "https://github.com/luispv05/music-patern-analysis/blob/main/src/clustering_pca.py"
click node_kselection "https://github.com/luispv05/music-patern-analysis/blob/main/src/clustering_k.py"
click node_clusterprofile "https://github.com/luispv05/music-patern-analysis/blob/main/src/clustering_perfil.py"
click node_popbase "https://github.com/luispv05/music-patern-analysis/blob/main/src/popularidad_base.py"
click node_trees "https://github.com/luispv05/music-patern-analysis/blob/main/src/popularidad_arboles.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_raw,node_clean,node_processed,node_anomalies toneBlue
class node_overview,node_quality,node_statistics,node_distributions,node_correlations toneAmber
class node_genreprofiles,node_genreheatmap toneMint
class node_featureprep,node_pca,node_kselection,node_clusterprofile toneRose
class node_popbase,node_trees,node_analyst toneIndigo
```

## Components

### Data preparation

- [Raw dataset](https://github.com/luispv05/music-patern-analysis/tree/main/data/raw): `data/raw`
- [Cleaning](https://github.com/luispv05/music-patern-analysis/blob/main/src/limpieza.py): `src/limpieza.py`
- [Processed datasets](https://github.com/luispv05/music-patern-analysis/tree/main/data/processed): `data/processed`
- [Anomaly counts](https://github.com/luispv05/music-patern-analysis/blob/main/src/limpieza_anomalias.py): `src/limpieza_anomalias.py`

### Exploratory analysis

- [Dataset overview](https://github.com/luispv05/music-patern-analysis/blob/main/src/eda_overview.py): `src/eda_overview.py`
- [Data quality](https://github.com/luispv05/music-patern-analysis/blob/main/src/eda_calidad.py): `src/eda_calidad.py`
- [Descriptive statistics](https://github.com/luispv05/music-patern-analysis/blob/main/src/eda_estadisticos.py): `src/eda_estadisticos.py`
- [Feature distributions](https://github.com/luispv05/music-patern-analysis/blob/main/src/eda_distribuciones.py): `src/eda_distribuciones.py`
- [Feature correlations](https://github.com/luispv05/music-patern-analysis/blob/main/src/eda_correlacion.py): `src/eda_correlacion.py`

### Genre analysis

- [Genre profiles](https://github.com/luispv05/music-patern-analysis/blob/main/src/generos_perfil.py): `src/generos_perfil.py`
- [Genre heatmap](https://github.com/luispv05/music-patern-analysis/blob/main/src/generos_heatmap.py): `src/generos_heatmap.py`

### Clustering

- [Feature preparation](https://github.com/luispv05/music-patern-analysis/blob/main/src/preparacion.py): `src/preparacion.py`
- [PCA analysis](https://github.com/luispv05/music-patern-analysis/blob/main/src/clustering_pca.py): `src/clustering_pca.py`
- [Cluster selection](https://github.com/luispv05/music-patern-analysis/blob/main/src/clustering_k.py): `src/clustering_k.py`
- [Cluster profiling](https://github.com/luispv05/music-patern-analysis/blob/main/src/clustering_perfil.py): `src/clustering_perfil.py`

### Popularity models

- [Baseline models](https://github.com/luispv05/music-patern-analysis/blob/main/src/popularidad_base.py): `src/popularidad_base.py`
- [Tree models](https://github.com/luispv05/music-patern-analysis/blob/main/src/popularidad_arboles.py): `src/popularidad_arboles.py`

### Other components

- **Analyst**

## Connections

- Analyst → Cleaning: runs (evidence: `README.md`)
- Raw dataset → Cleaning: reads (evidence: `src/limpieza.py`)
- Cleaning → Processed datasets: writes datasets (evidence: `src/limpieza.py`)
- Analyst → Anomaly counts: may run (evidence: `README.md`)
- Analyst → Dataset overview: runs (evidence: `README.md`)
- Analyst → Data quality: runs (evidence: `README.md`)
- Analyst → Descriptive statistics: runs (evidence: `README.md`)
- Analyst → Feature distributions: runs (evidence: `README.md`)
- Raw dataset → Feature distributions: reads (evidence: `src/eda_distribuciones.py`)
- Analyst → Feature correlations: runs (evidence: `README.md`)
- Raw dataset → Feature correlations: reads (evidence: `src/eda_correlacion.py`)
- Analyst → Genre profiles: runs (evidence: `README.md`)
- Analyst → Genre heatmap: runs (evidence: `README.md`)
- Processed datasets → Genre heatmap: reads (evidence: `src/generos_heatmap.py`)
- Analyst → Feature preparation: runs (evidence: `README.md`)
- Processed datasets → Feature preparation: loads unique tracks (evidence: `src/preparacion.py`)
- Analyst → PCA analysis: runs (evidence: `README.md`)
- Feature preparation → PCA analysis: prepares features (evidence: `src/clustering_pca.py`)
- Analyst → Cluster selection: runs (evidence: `README.md`)
- Feature preparation → Cluster selection: prepares features (evidence: `src/clustering_k.py`)
- Analyst → Cluster profiling: runs (evidence: `README.md`)
- Feature preparation → Cluster profiling: prepares features (evidence: `src/clustering_perfil.py`)
- Analyst → Baseline models: runs (evidence: `README.md`)
- Feature preparation → Baseline models: provides features (evidence: `src/popularidad_base.py`)
- Analyst → Tree models: runs (evidence: `README.md`)
- Baseline models → Tree models: provides loader (evidence: `src/popularidad_arboles.py`)
