FlyRank ML Internship — Capstone Research Page
health_score,
quick-win tags). This project asks the question those rules can't answer on their own: across a
32-client, 30,000-page content portfolio, which pages have the greatest opportunity to improve
click-through rate, and can a learned model out-rank the existing rule at picking which ones a
human should review first? A client-grouped, leakage-checked random forest was trained on 90-day
traffic and search-console signals and compared against a transparent CTR-gap-by-position-tier
rule — the same kind of rule the product uses today — on the same held-out split.
On unseen clients, the model reaches precision@50 of 0.82 against a 0.51 base rate and a
0.82 baseline-rule precision@50 — matching the simple rule at that depth while beating it at
K=20 (0.95 vs 0.85) and K=100 (0.85 vs 0.75), and a naive (non-grouped) split is shown to overstate
performance by 10–24 points at the same K, which is why the grouped split is used throughout.
The output is packaged as a ranked, reason-coded action queue with six page archetypes and an
explicit no-go list — a decision-support triage aid for a human reviewer, not an autonomous
publishing system.
FlyRank runs content as infrastructure: it researches, writes, and publishes pages into a client's site, then keeps watching search data after publication. That's where the hard part starts. A page that ranked well on day one can quietly decay — rankings slip, clicks drop — and across a portfolio of thousands of pages spanning dozens of clients, nobody can manually review every one every week. Some pages are already ranking well in search but converting almost none of their impressions into clicks — a title, snippet, or intent mismatch is quietly leaving traffic on the table. Others are simply stale, buried, or genuinely low-demand. Reviewing all of them costs time the team doesn't have; reviewing the wrong ones costs opportunity the team can't get back.
Today that triage runs on hand-tuned rule flags — a health_score, quick-win tags,
needs-attention thresholds someone chose by hand. They work, and they run in production, but rules
run out where signals get many, tangled, and shifting. This project asks the narrow, answerable
version of that gap: given a page's traffic and search signals, can a learned model rank pages by
how likely they are to be declining, well enough that a human reviewer working from the top of the
list finds real problems far more often than chance — and does it beat the rule already in
production? The output is not a verdict on any single page — it is a shortlist, with a
plain-language reason attached to each entry, meant to make a Monday-morning review meeting more
productive.
The analysis uses the FlyRank ML Internship starter release: content_refresh_anonymized.csv,
a single trailing-90-day snapshot combining Google Search Console-style metrics (impressions, clicks,
CTR, average position) with on-site analytics (sessions, engagement rate, scroll behavior) and content
metadata (word count, content type, age, last-update date) for every page in the portfolio.
What was excluded, and why:
| Column(s) | Why excluded |
|---|---|
| trend_direction, trend_pct | These define the label (is_declining_label = trend_direction == "down"). Using them as inputs would be direct leakage. |
| content_id, client_id | Pseudonymous identifiers — used only for grouping the train/test split and joins, never as model features. |
| provider_used, model_used | Marked "not a model feature" in the dataset's own data dictionary. |
| baseline_score, ctr_gap, reason_code | Decision-derived outputs from the Week-4 rule itself — encode a prior judgment, not raw signal. |
client_id, content_id) — no client names,
URLs, or raw search queries appear anywhere in this analysis or its outputs.
Label. is_declining_label = 1 if trend_direction == "down" (a 30-day
vs. previous-30-day impression trend already computed in the dataset), else 0. This is a proxy for
"worth reviewing," not a ground-truth business outcome like revenue or ranking loss — see
Limitations.
Features (29 numeric + 8 categorical, one-hot encoded). Search and traffic volume
(impressions, clicks, sessions, users, engaged sessions), CTR and position, engagement and scroll
behavior, content metadata (word count, age, days since last update), and tier labels
(position/impression/freshness/word-count tiers). Missing numeric values are imputed to 0 with an
explicit "has this field" flag; missing categoricals become an explicit "unknown" category
— a page's own missingness is a real, potentially informative pattern, not something to hide.
Baseline. A transparent Week-4 rule: for each position_tier (top_3, page_1,
striking, page_3_5, deep), compute the tier's own average CTR from the training clients only, flag a
page if its impressions ≥ 500 (enough traffic to trust the ratio) and its CTR sits below its
tier's benchmark, and score flagged pages by the size of that gap. This is the standard a real editor
could run by hand in a spreadsheet — the model has to beat it to earn its complexity.
Validation design. Rows are grouped by client_id before splitting — 25 clients
(23,837 rows) in training, 7 different, unseen clients (6,163 rows) held out for testing. This matters:
a naive random 80/20 split puts 31 of the 32 clients on both sides, letting the model partly memorize
client-specific quirks instead of learning transferable signal. The chart in
Results shows exactly how much that inflates the numbers.
Leakage checks. Beyond excluding the label-defining columns, the strongest feature by
permutation importance (impressions_last_30d) was dropped and the model retrained: precision@50
fell from 0.82 to 0.62 — a real drop, consistent with a genuinely informative (if aggressive) feature
rather than a collapse straight back to the 0.51 base rate, which is what outright leakage would look
like. This is a judgment call, not a proof, and is revisited honestly in
Limitations.
Models compared, same split, same metric. The Week-4 rule (baseline), logistic regression
(scaled features), and a random forest (300 trees, max depth 8, min 20 samples/leaf, all seeded at
random_state=42). Precision@K (K = 20, 50, 100) is the primary metric, reported next to the
base rate every time — a high score next to a high base rate says nothing on its own.
| K | Base rate | Baseline rule | Logistic regression | Random forest |
|---|---|---|---|---|
| 20 | 0.51 | 0.85 | 1.00 | 0.95 |
| 50 | 0.51 | 0.82 | 1.00 | 0.82 |
| 100 | 0.51 | 0.75 | 1.00 | 0.85 |
impressions_last_30d and impressions_prev_30d,
the same 30-day windows the label's own trend calculation is built from. It is likely riding very
close to the label's own arithmetic rather than learning a generalizable pattern. The random forest,
with a shallower max depth and a leaf-size floor, is the more conservative, more honestly-behaved
model and is used for the ranked queue in Recommendations.
Error read. In the honest split's top-20 queue, 1 of 20 flagged pages was a false positive —
a page_3_5 page with zero CTR that the dataset actually labels "stable," not declining.
That is a low, workable false-positive rate for a triage tool a human still reviews before acting.
is_declining_label is itself a proxy inherited from
the dataset design (a 30-day trend flag), not a ground-truth business outcome.The validated model's held-out scores are turned into a ranked, reason-coded queue: 2,968 pages get a specific suggested action; 3,195 more are set aside as "insufficient data" (under 500 impressions — not enough traffic to trust a CTR read) rather than force-ranked. Every reason code traces to a raw, checkable column, never to the model's internal score alone.
| Reason code | Suggested action | Typical effort |
|---|---|---|
| high_impressions_low_ctr | Rewrite title / meta description | Low |
| buried_high_demand_page | Improve position / internal links | Medium |
| weak_engagement_vs_type_median | Improve on-page engagement | Medium |
| stale_content_181d_plus | Refresh content | Medium–High |
| low_visibility_insufficient_data | Monitor only | ~Zero |
Cheapest lever first: title/meta rewrites are worth trying on almost any flagged page with real traffic, before committing to an expensive content refresh — the same ranked score, triaged by effort, reviews more pages per hour of editor time.
A blanket "refresh anything untouched for six-plus months" rule would spend effort on the bucket that, here, is least likely to be declining. Staleness is kept as one tiebreaker inside the model-ranked queue, never a standalone trigger.
Before acting on any row, a human checks: sample-size sanity, live SERP context (featured snippets, strong competitors), data artifacts (e.g. missing fields), cannibalization from sibling URLs, and brand/legal sign-off where relevant.
Monitoring / retrain triggers (illustrative, not production-tuned): precision@50 dropping more than ~10 points below this snapshot's value on a fresh labeled sample; more than ~20% of the portfolio being new clients unseen in training; or a full quarter passing regardless of drift.
Every number and chart on this page traces back to a notebook in the repo, in this order:
w01_research_question.ipynb — lane choice and research questionw03_data_contract.ipynb — data contract and exclusionsw04_baseline_score.ipynb — the transparent baseline rulew05_model.ipynb — model training and comparisonw06_validation_audit.ipynb — grouped split, leakage audit, claim rewritesw07_action_playbook.ipynb — ranked queue, archetypes, no-go listcapstone.ipynb — the notebook this page mirrors, end to end
Every model in this project is seeded with random_state=42. Rerunning any notebook top to
bottom from a fresh clone of
the repo
reproduces every number on this page exactly, using the same starter CSV
(data/raw/content_refresh_anonymized.csv) and the same client-grouped split.