2026-10-26 15:18:14 +05:30
# HIFFI Hip-Hop 500 — Multi-Platform Artist Intelligence Pipeline
2026-10-22 11:36:00 +05:30
2026-10-26 15:48:26 +05:30
A Python-based pipeline for collecting, validating, scoring, and ranking hip-hop artists using YouTube, Spotify, and Instagram signals. It includes data freshness checks, identity verification, anomaly detection, publication eligibility rules, and regression auditing.
2026-10-23 10:52:54 +05:30
2026-10-26 15:18:14 +05:30
## Key Features
2026-10-23 10:52:54 +05:30
2026-10-26 15:48:26 +05:30
- Multi-platform artist metrics and scoring.
- Instagram identity matching with review-queue support.
- Missing-data handling and dynamic weight redistribution.
- Platform freshness and publication eligibility gates.
- Cross-platform anomaly detection.
- Regression auditing and rank-shift reports.
- Automated tests and GitHub Actions CI for Python 3.11 and 3.12.
2026-10-23 10:52:54 +05:30
2026-10-26 15:48:26 +05:30
## Pipeline Architecture: Telemetry Ingestion vs. Ranking Core
2026-10-23 10:52:54 +05:30
2026-10-26 15:48:26 +05:30
The project separates data collection from ranking so that platform data can be refreshed independently of score calculation.
2026-10-23 10:52:54 +05:30
2026-10-26 15:48:26 +05:30
### 1. Telemetry Ingestion Layer — `pipeline/batch_500_runner.py`
2026-10-23 10:52:54 +05:30
2026-10-26 15:48:26 +05:30
- Collects multi-platform telemetry through configured API calls and web scraping.
- Uses checkpoints in `data/checkpoints/` to support recovery after interrupted runs and reduce repeated data requests.
- Saves the refreshed master cohort dataset to `data/hiffi_multiplatform_500.csv` .
2026-10-23 10:52:54 +05:30
2026-10-26 15:48:26 +05:30
### 2. Ranking and Governance Core — `run_pipeline.py`
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
- Loads `data/hiffi_multiplatform_500.csv` and executes the ranking workflow independently of data collection.
- Handles missing metrics, redistributes weights across available signals, checks data freshness, and flags suspicious records.
- Applies publication eligibility rules and assigns published ranks.
- Generates an audit report at `reports/audit_report_latest.md` .
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
## Ranking Methodology
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
The project uses separate scores for artist production performance, multi-platform ranking, and breakout potential.
### HIFFI-XP Multi-Platform Score
| Signal | Base Weight |
2026-10-24 15:57:20 +05:30
|---|---:|
2026-10-26 15:18:14 +05:30
| YouTube production score | 50% |
| Spotify monthly listeners | 25% |
2026-10-26 15:48:26 +05:30
| Spotify daily stream velocity | 5% |
2026-10-26 15:18:14 +05:30
| Instagram followers | 20% |
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
When some signals are unavailable, the scoring logic redistributes their weights proportionally across the available signals. The effective weights are recorded in `effective_weights` for auditability.
2026-10-24 15:57:20 +05:30
2026-10-26 15:18:14 +05:30
### YouTube Production Score
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
The production score uses the following components:
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
| Component | Weight |
2026-10-26 15:18:14 +05:30
|---|---:|
| Recent momentum | 35% |
2026-10-26 15:48:26 +05:30
| View velocity | 30% |
2026-10-26 15:18:14 +05:30
| Audience reach | 20% |
| Consistency proxy | 15% |
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
Audience reach combines subscriber and lifetime-view signals. The score also uses confidence and eligibility checks where supported by the ranking implementation.
2026-10-24 15:57:20 +05:30
2026-10-26 15:18:14 +05:30
### Breakout Velocity Index (BVI)
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
The Breakout Velocity Index identifies artists showing growth potential based on available velocity signals. A 10,000-subscriber floor is used by the BVI logic to reduce the impact of very small accounts.
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
**Note:** The project's internal scoring methodology is not necessarily identical to the public HIFFI website's ranking formula.
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
## Identity Verification Gates
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
Only Instagram profiles that pass the configured verification rules qualify for multi-platform credit.
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
- **`AUTOMATED_VERIFIED` :** Confidence ≥ `0.55` , or confidence ≥ `0.40` with follower corroboration ≥ `10,000` .
- **`UNVERIFIED` :** Accounts that do not meet verification requirements.
- **`UNCERTAIN_NEEDS_REVIEW` :** Ambiguous account matches requiring human review.
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
Unverified accounts, low-follower outliers below `10,000` , and ambiguous handles are routed to `data/review_queue.csv` for review and excluded from multi-platform tier credit.
Follower count is a supporting signal, not proof of identity. The verification status and publication eligibility rules determine whether an account can contribute evidence.
## Data Freshness and Publication Eligibility
The ranking engine uses freshness windows to determine whether platform data qualifies as current evidence.
| Platform | Maximum Data Age |
2026-10-26 15:18:14 +05:30
|---|---:|
| YouTube | 7 days |
| Spotify | 7 days |
| Instagram | 14 days |
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
Missing, unparseable, or stale timestamps do not qualify for platform evidence credit. The engine records exclusion reasons in `evidence_exclusions` , such as `STALE_OR_MISSING_SPOTIFY_TIMESTAMP` .
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
A platform's evidence may be excluded from publication eligibility while its available metric can still contribute to a continuous score. Therefore, score calculation and publication eligibility are separate decisions.
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
## Missing-Data Handling
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
- Preserve missing values as `NaN` where supported by the data and scoring logic.
- Do not treat failed API requests as genuine zero-valued metrics.
- Redistribute weights across available signals according to the scoring implementation.
- Record effective weights so ranking results can be inspected and explained.
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
Some individual scoring functions may apply documented defaults. Review the relevant implementation before assuming every missing value remains `NaN` throughout all calculations.
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
## Anomaly Detection
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
Before publication, the pipeline flags suspicious cross-platform metric relationships for audit review.
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
| Flag | Condition |
|---|---|
| `SUSPICIOUS_IG_TO_YT_RATIO` | Instagram followers exceed YouTube lifetime views by more than 10× . |
| `EXTREME_SPOTIFY_VELOCITY_RATIO` | Daily stream growth exceeds 25% of monthly listeners. |
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
Flags are recorded in `anomaly_flags` so suspicious records can be investigated rather than silently ignored. A flag should trigger review; it does not, by itself, prove that the data is fraudulent.
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
## Regression Auditing
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
The regression auditor compares current ranking output against saved baselines.
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
- Baselines are stored in `data/snapshots/` .
- Rank movements greater than 100 positions (`|rank shift| > 100` ) are identified for review.
- The latest report is written to `reports/audit_report_latest.md` .
Large ranking changes may reflect genuine changes in platform signals, data availability, scoring weights, or identity verification. They should be reviewed before publication.
## Project Structure
2026-10-23 10:52:54 +05:30
```text
2026-10-23 15:48:38 +05:30
hiffi-artist-intelligence/
├── collectors/
2026-10-24 15:57:20 +05:30
│ ├── instagram_verifier.py
2026-10-26 15:48:26 +05:30
│ ├── spotify_api_collector.py
│ └── spotify_fallback_collector.py
2026-10-23 15:48:38 +05:30
├── core/
2026-10-26 15:18:14 +05:30
│ ├── ranking_engine.py
│ └── regression_auditor.py
2026-10-23 15:48:38 +05:30
├── data/
2026-10-26 15:18:14 +05:30
│ ├── checkpoints/
2026-10-26 15:48:26 +05:30
│ ├── snapshots/
2026-10-26 15:18:14 +05:30
│ ├── review_queue.csv
2026-10-24 15:57:20 +05:30
│ └── hiffi_multiplatform_500.csv
2026-10-23 15:48:38 +05:30
├── pipeline/
2026-10-26 15:48:26 +05:30
│ └── batch_500_runner.py
2026-10-26 15:18:14 +05:30
├── reports/
2026-10-26 15:48:26 +05:30
│ └── audit_report_latest.md
├── tests/
2026-10-26 15:18:14 +05:30
├── run_pipeline.py
2026-10-23 15:48:38 +05:30
├── test_multiplatform_ranking.py
2026-10-24 15:57:20 +05:30
├── requirements.txt
2026-10-26 15:48:26 +05:30
├── .env.example
2026-10-24 15:57:20 +05:30
└── README.md
2026-10-23 10:52:54 +05:30
```
2026-10-26 15:48:26 +05:30
The tree shows the intended layout. Keep only files and folders that actually exist in the repository.
2026-10-23 15:48:38 +05:30
2026-10-26 15:48:26 +05:30
## Requirements
2026-10-23 15:48:38 +05:30
2026-10-26 15:18:14 +05:30
- Python 3.11 or 3.12
2026-10-23 15:48:38 +05:30
- Git
2026-10-26 15:48:26 +05:30
- API credentials for any integrations that require authentication
2026-10-23 10:52:54 +05:30
2026-10-26 15:48:26 +05:30
## Setup
### 1. Clone the repository
2026-10-23 10:52:54 +05:30
```bash
2026-10-26 15:48:26 +05:30
git clone <YOUR_REPOSITORY_URL>
2026-10-23 15:48:38 +05:30
cd hiffi-artist-intelligence
2026-10-23 10:52:54 +05:30
```
2026-10-26 15:48:26 +05:30
Replace `<YOUR_REPOSITORY_URL>` with your repository's clone URL.
### 2. Create a virtual environment
2026-10-23 15:48:38 +05:30
2026-10-26 15:18:14 +05:30
**Windows PowerShell**
2026-10-23 15:48:38 +05:30
```powershell
2026-10-23 10:52:54 +05:30
python -m venv . venv
2026-10-24 15:57:20 +05:30
.\. venv \ Scripts \ Activate . ps1
2026-10-26 15:48:26 +05:30
```
**macOS/Linux**
```bash
python3 -m venv .venv
source .venv/bin/activate
```
### 3. Install dependencies
```bash
python -m pip install --upgrade pip
2026-10-23 10:52:54 +05:30
pip install -r requirements.txt
```
2026-10-26 15:48:26 +05:30
### 4. Configure environment variables
2026-10-23 10:52:54 +05:30
2026-10-26 15:48:26 +05:30
Create a local `.env` file using `.env.example` as a guide. Add the credentials required by your enabled integrations, for example:
2026-10-23 10:52:54 +05:30
2026-10-26 15:48:26 +05:30
```dotenv
SPOTIFY_CLIENT_ID=your_spotify_client_id
SPOTIFY_CLIENT_SECRET=your_spotify_client_secret
2026-10-24 15:57:20 +05:30
```
2026-10-26 15:48:26 +05:30
Use the actual variable names expected by your collectors. Never commit `.env` files or live API credentials to Git.
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
## Running the Pipeline
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
### Refresh platform data
2026-10-24 15:57:20 +05:30
2026-10-26 15:48:26 +05:30
If `pipeline/batch_500_runner.py` is implemented as the ingestion entry point, run:
```bash
python -m pipeline.batch_500_runner
```
This stage should refresh the master dataset and use checkpoints where supported.
### Calculate rankings and generate the audit report
2026-10-23 10:52:54 +05:30
```bash
2026-10-26 15:18:14 +05:30
python run_pipeline.py
2026-10-23 10:52:54 +05:30
```
2026-10-26 15:48:26 +05:30
This stage consumes the available master dataset, applies scoring and governance rules, and produces ranking outputs and the audit report.
2026-10-23 10:52:54 +05:30
2026-10-26 15:48:26 +05:30
### Run tests
2026-10-23 10:52:54 +05:30
2026-10-26 15:18:14 +05:30
```bash
python -m pytest test_multiplatform_ranking.py -v
```
2026-10-23 10:52:54 +05:30
2026-10-26 15:48:26 +05:30
### Run the regression auditor
2026-10-23 15:48:38 +05:30
2026-10-26 15:18:14 +05:30
```bash
python -m core.regression_auditor
```
2026-10-26 15:48:26 +05:30
Use the exact commands and test paths defined by the current repository.
2026-10-26 15:18:14 +05:30
2026-10-26 15:48:26 +05:30
## Testing and Continuous Integration
2026-10-26 15:18:14 +05:30
2026-10-26 15:48:26 +05:30
The project reports 27 passing unit and integration tests, with GitHub Actions checks passing on Python 3.11 and 3.12 on Ubuntu.
2026-10-26 15:18:14 +05:30
2026-10-26 15:48:26 +05:30
The test suite is intended to cover ranking behavior, missing-data handling, freshness and eligibility gates, anomaly detection, and regression safeguards.
2026-10-26 15:18:14 +05:30
2026-10-26 15:48:26 +05:30
Test results should be confirmed against the latest commit before a release is declared complete.
2026-10-26 15:18:14 +05:30
2026-10-26 15:48:26 +05:30
## Important Output Fields
2026-10-26 15:18:14 +05:30
2026-10-26 15:48:26 +05:30
| Field | Purpose |
2026-10-23 15:48:38 +05:30
|---|---|
2026-10-26 15:48:26 +05:30
| `production_hiffi_score` | YouTube production-performance score. |
| `hiffi_xp_score` | Combined multi-platform score. |
| `hiffi_xp_rank` | Raw multi-platform ranking position. |
| `hiffi_xp_published_rank` | Published ranking position after eligibility rules. |
| `breakout_velocity_index` | Breakout potential score. |
| `breakout_rank` | Breakout ranking position. |
| `effective_weights` | Weights applied to the available signals. |
| `platform_evidence_tier` | Platform evidence tier used for eligibility. |
| `evidence_exclusions` | Reasons platform evidence was excluded. |
| `anomaly_flags` | Potentially suspicious metric relationships. |
| `rank_delta` | Change in ranking position relative to the comparison baseline. |
2026-10-23 15:48:38 +05:30
2026-10-26 15:48:26 +05:30
Actual output columns depend on the current implementation and input dataset.
2026-10-23 15:48:38 +05:30
2026-10-26 15:48:26 +05:30
## Security and Data Governance
2026-10-23 15:48:38 +05:30
2026-10-26 15:48:26 +05:30
- Keep API keys in environment variables, not source code.
- Keep `.env` and local credentials out of version control.
- Review uncertain artist identities before granting platform evidence credit.
- Keep data timestamps and exclusion reasons available for auditing.
- Investigate large rank shifts and anomaly flags before publication.
- Do not interpret a missing metric as a confirmed zero unless the relevant scoring rule explicitly defines that behavior.
2026-10-23 15:48:38 +05:30
2026-10-26 15:48:26 +05:30
## Limitations
2026-10-23 15:48:38 +05:30
2026-10-26 15:48:26 +05:30
- API access, quotas, and authentication can affect data availability.
- Platform metrics may have different refresh schedules and definitions.
- Similar artist names and unofficial social accounts can produce ambiguous identity matches.
- Anomaly rules identify unusual relationships, not necessarily fraudulent activity.
- Rankings depend on data quality, available signals, and the configured weighting methodology.
- Automated tests cannot guarantee that every live platform account or metric is correct.
2026-10-23 15:48:38 +05:30
2026-10-26 15:48:26 +05:30
## Future Improvements
2026-10-23 15:48:38 +05:30
2026-10-26 15:48:26 +05:30
- Expand identity verification using reliable official account evidence.
- Improve source-level data validation and stale-data monitoring.
- Add operational alerts for failed or incomplete ingestion runs.
- Strengthen checkpoint recovery and API retry behavior.
- Track ranking changes across releases and review significant shifts.
- Automate recurring regression reports and release checks.
2026-10-23 15:48:38 +05:30
2026-10-26 15:48:26 +05:30
## Summary
HIFFI Hip-Hop 500 separates platform data ingestion from ranking and governance. Its scoring, identity checks, freshness controls, anomaly flags, and regression reports are designed to make multi-platform rankings more consistent, explainable, and auditable.
For production use, verify that the documented entry points, thresholds, checkpoint behavior, and output paths match the implementation in the released repository.