Inspiration
Every creator we know has felt the same dread before pressing Publish — "Is this title strong enough? Is 8 PM really better than 11 AM? Do tags even matter anymore?" The advice online is contradictory and almost always anecdotal: a single creator's lucky upload turned into a universal rule.
We wanted to flip that. Trending data is public, multi-country, and huge — so why is creator intuition still the default? YouTube Viral Advisor was born from a simple thesis: if we treat virality as a calibrated probability instead of a vibe, we can give creators the same kind of decision support that data scientists give product managers.
How we built it
Data pipeline. We unified ~228 MB of trending CSVs across 11 countries (US, GB, JP, KR, IN, BR, CA, DE, FR, MX, RU) into a single cleaned table of ~178K videos, mapping category_id to readable names, parsing UTC publish times into hour/day-of-week, and engineering 6 NLP title features (length, word count, ALL-CAPS ratio, digit/question/exclamation flags).
Model. A HistGradientBoostingClassifier (300 iters, max_depth=8, lr=0.08, L2 = 1.0, early stopping) wrapped in CalibratedClassifierCV with isotonic calibration so the output is a real probability, not just a ranking score:
$$\hat{p}{\text{calibrated}} = g\bigl(f{\text{GBT}}(x)\bigr), \quad g = \text{isotonic regression on a held-out fold}$$
What we learned
- Calibration matters more than rank. A raw GBT gave us nearly the same AUC, but its probabilities were squashed near 0.5 — useless for telling a creator "you have a 38% shot." Isotonic calibration (Brier $0.124$) was the single biggest product win even though it barely moved AUC.
- Country and category dominate. We assumed title NLP would lead — it didn't. The audience you're competing in matters more than the words you choose, which reframed the recommendation copy on the Advisor page.
- Pre-publish only is a hard constraint. Removing views, likes, and comments from features felt restrictive but is the only honest setup — leaking post-publish signals would have inflated AUC well past 0.95 and made the tool useless.
Challenges we ran into
- Leaky targets. Our first model hit AUC $\approx 0.97$ — because like_ratio was implicitly encoding the outcome. We rebuilt the feature schema to be strictly pre-publish.
- Class imbalance and threshold drift. The 25/75 split made naive accuracy meaningless; we moved to PR AUC + Brier and reported per-class precision/recall on the Insights page instead.
- Tag delimiters. Across 11 countries, tags came |
-, ,-, and ;-separated — sometimes mixed in the same file. A single re.splitregex saved a lot of downstream bugs. - Calibration vs. permutation cost. CalibratedClassifierCV + 10-repeat permutation importance pushed training past the 5-minute mark; we sub-sampled the importance step to 3 000 rows to keep the train loop iterable.
- Making the UI feel like a product, not a notebook. Streamlit's defaults scream demo. Custom CSS, an Altair theme, and KPI cards took longer than the model itself — but it's the difference between "cool experiment" and "I'd actually use this."
Built With
- altair
- fpdf
- joblib
- nltk
- numpy
- pandas
- python
- scikit-learn
- streamlit
Log in or sign up for Devpost to join the conversation.