# sansk552/upworthy-headline-ab-testing architecture

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

- Interactive diagram: https://gitdiagram.com/sansk552/upworthy-headline-ab-testing
- Repository: https://github.com/sansk552/upworthy-headline-ab-testing

## Overview

This repository is an analysis project for finding how headline features relate to click-through rate in Upworthy A/B tests. The documented workflow validates the archive, identifies and excludes a period with randomization problems, builds clean test/package data, then analyzes headline features with SQL summaries and Python statistical analysis. The graph follows the README’s numbered stages and capabilities; source excerpts were not provided, so implementation-level calls and data transfers beyond those documented are not asserted.

Main entry points: [`sql/sql12_create_packages_clean.sql`](https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql12_create_packages_clean.sql) (Clean package creation), [`notebooks/upworthy_ab_testing.ipynb`](https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/notebooks/upworthy_ab_testing.ipynb) (Feature engineering), [`sql/sql1_row_count.sql`](https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql1_row_count.sql) (Initial data checks), [`sql/sql6_test_size.sql`](https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql6_test_size.sql) (Test structure checks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sql_quality["SQL data quality"]
  node_initial_checks["Initial data checks<br/>[sql1_row_count.sql]"]
  node_structure_checks["Test structure checks<br/>[sql6_test_size.sql]"]
  node_randomization["Randomization check"]
  node_valid_tests["Valid test creation"]
  node_clean_packages["Clean package creation"]
end

subgraph group_sql_analysis["SQL analysis"]
  node_clean_summary["Clean data summary"]
  node_headline_features["Headline feature summaries"]
  node_winner_analysis["Winner analysis"]
  node_test_level_analysis["Paired test analysis"]
end

subgraph group_python_analysis["Python analysis"]
  node_case_study["Experiment case study"]
  node_feature_engineering["Feature engineering"]
  node_paired_meta["Paired meta-analysis"]
  node_length_correlation["Length correlation"]
  node_visualizations["Analysis visualizations"]
end

node_analyst(("Analyst"))
node_archive["Upworthy archive"]
node_raw_data[("Raw packages")]

node_archive -->|"provides dataset"| node_raw_data
node_analyst -.->|"runs checks"| node_initial_checks
node_raw_data -->|"checks rows"| node_initial_checks
node_initial_checks -->|"examines tests"| node_structure_checks
node_structure_checks -->|"checks assignment"| node_randomization
node_randomization -->|"identifies exclusions"| node_valid_tests
node_valid_tests -->|"filters packages"| node_clean_packages
node_clean_packages -->|"summarizes data"| node_clean_summary
node_clean_packages -->|"summarizes features"| node_headline_features
node_clean_packages -->|"analyzes winners"| node_winner_analysis
node_clean_packages -->|"compares within tests"| node_test_level_analysis
node_analyst -.->|"runs analysis"| node_case_study
node_case_study -->|"prepares features"| node_feature_engineering
node_feature_engineering -->|"compares features"| node_paired_meta
node_feature_engineering -->|"measures association"| node_length_correlation
node_paired_meta -.->|"visualizes findings"| node_visualizations
node_length_correlation -.->|"visualizes findings"| node_visualizations

click node_raw_data "https://github.com/sansk552/upworthy-headline-ab-testing/tree/main/data/raw"
click node_initial_checks "https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql1_row_count.sql"
click node_structure_checks "https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql6_test_size.sql"
click node_randomization "https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql9_randomization_check.sql"
click node_valid_tests "https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql11_create_valid_tests.sql"
click node_clean_packages "https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql12_create_packages_clean.sql"
click node_clean_summary "https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql13_clean_data_summary.sql"
click node_headline_features "https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql14_headline_features.sql"
click node_winner_analysis "https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql15_winner_analysis.sql"
click node_test_level_analysis "https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql16_test_level_analysis.sql"
click node_case_study "https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/notebooks/upworthy_ab_testing.ipynb"
click node_feature_engineering "https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/notebooks/upworthy_ab_testing.ipynb"
click node_paired_meta "https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/notebooks/upworthy_ab_testing.ipynb"
click node_length_correlation "https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/notebooks/upworthy_ab_testing.ipynb"
click node_visualizations "https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/notebooks/upworthy_ab_testing.ipynb"

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_initial_checks,node_structure_checks,node_randomization,node_valid_tests,node_clean_packages toneBlue
class node_clean_summary,node_headline_features,node_winner_analysis,node_test_level_analysis,node_raw_data toneAmber
class node_case_study,node_feature_engineering,node_paired_meta,node_length_correlation,node_visualizations toneMint
class node_analyst,node_archive toneIndigo
```

## Components

### SQL data quality

- [Initial data checks](https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql1_row_count.sql): `sql/sql1_row_count.sql`
- [Test structure checks](https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql6_test_size.sql): `sql/sql6_test_size.sql`
- [Randomization check](https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql9_randomization_check.sql): `sql/sql9_randomization_check.sql`
- [Valid test creation](https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql11_create_valid_tests.sql): `sql/sql11_create_valid_tests.sql`
- [Clean package creation](https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql12_create_packages_clean.sql): `sql/sql12_create_packages_clean.sql`

### SQL analysis

- [Clean data summary](https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql13_clean_data_summary.sql): `sql/sql13_clean_data_summary.sql`
- [Headline feature summaries](https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql14_headline_features.sql): `sql/sql14_headline_features.sql`
- [Winner analysis](https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql15_winner_analysis.sql): `sql/sql15_winner_analysis.sql`
- [Paired test analysis](https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/sql/sql16_test_level_analysis.sql): `sql/sql16_test_level_analysis.sql`

### Python analysis

- [Experiment case study](https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/notebooks/upworthy_ab_testing.ipynb): `notebooks/upworthy_ab_testing.ipynb`
- [Feature engineering](https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/notebooks/upworthy_ab_testing.ipynb): `notebooks/upworthy_ab_testing.ipynb`
- [Paired meta-analysis](https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/notebooks/upworthy_ab_testing.ipynb): `notebooks/upworthy_ab_testing.ipynb`
- [Length correlation](https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/notebooks/upworthy_ab_testing.ipynb): `notebooks/upworthy_ab_testing.ipynb`
- [Analysis visualizations](https://github.com/sansk552/upworthy-headline-ab-testing/blob/main/notebooks/upworthy_ab_testing.ipynb): `notebooks/upworthy_ab_testing.ipynb`

### Other components

- **Analyst**
- **Upworthy archive**
- [Raw packages](https://github.com/sansk552/upworthy-headline-ab-testing/tree/main/data/raw): `data/raw`

## Connections

- Upworthy archive → Raw packages: provides dataset (evidence: `README.md`)
- Analyst → Initial data checks: runs checks
- Raw packages → Initial data checks: checks rows (evidence: `README.md`)
- Initial data checks → Test structure checks: examines tests (evidence: `README.md`)
- Test structure checks → Randomization check: checks assignment (evidence: `README.md`)
- Randomization check → Valid test creation: identifies exclusions (evidence: `README.md`)
- Valid test creation → Clean package creation: filters packages (evidence: `README.md`)
- Clean package creation → Clean data summary: summarizes data (evidence: `README.md`)
- Clean package creation → Headline feature summaries: summarizes features (evidence: `README.md`)
- Clean package creation → Winner analysis: analyzes winners (evidence: `README.md`)
- Clean package creation → Paired test analysis: compares within tests (evidence: `README.md`)
- Analyst → Experiment case study: runs analysis
- Experiment case study → Feature engineering: prepares features (evidence: `README.md`)
- Feature engineering → Paired meta-analysis: compares features (evidence: `README.md`)
- Feature engineering → Length correlation: measures association (evidence: `README.md`)
- Paired meta-analysis → Analysis visualizations: visualizes findings
- Length correlation → Analysis visualizations: visualizes findings
