Module 15 β CapstonesΒΆ
π§ β CI/CD & Deployment Β· π Course home Β· Business AI βΆ
Goal: Apply everything from the technical track (NB 1β46) to ship two real-shape projects you can talk about in an interview or a code review.
Estimated time: 6β10 hours each if you work them as full projects β the guided run alone is ~75β120 min (Capstone A) and ~90β120 min (Capstone B). Capstone A is mostly analytical; Capstone B is mostly engineering.
Prerequisites: Capstone A: Notebooks 1β19 (Modules 1β5: Python, pandas, NumPy, visualization, statistics, scikit-learn). Capstone B: Notebooks 1β46 β especially AI engineering (NB 27β32) and production (NB 45β46).
The whole course (NB 1β46)
β
ββββββββββββββββββββββββ΄βββββββββββββββββββββββ
βΌ βΌ
Capstone A β Analytics (NB 47) Capstone B β AI Assistant (NB 48)
fed by Modules 1β5: fed by Modules 8 & 13:
Python Β· pandas Β· NumPy Β· seaborn Β· prompting Β· structured output Β·
statistics Β· scikit-learn RAG Β· validation Β· tracing Β·
eval gates Β· scheduling
β β
the *numbers* of a support the *text* the same support
operation β one executive summary operation produces β routed,
answered, costed tickets
β β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββ
βΌ
Two artefacts you can ship.
Capstones at a glanceΒΆ
# |
Notebook |
β± Time |
Difficulty |
Project |
|---|---|---|---|---|
47 |
|
~75β120 min |
Intermediate |
A complete analytical study of an AI support-bot deployment β 5 channels Γ 12 months of ops data β |
48 |
|
~90β120 min |
Advanced |
A complete AI feature β 50 overnight feedback messages classified with structured LLM output, validated, priority-routed, RAG-answered, and shipped as a scheduled daily report with tracing, a cost dashboard, and an eval gate drawn as a bullet chart |
Capstone guidesΒΆ
47 Β· Capstone A: AI-Driven Customer Support Analytics β 47_capstone_analytics.ipynbΒΆ
Youβve just joined a SaaS company that introduced an AI-powered support bot at the start of the year. The product manager wants one review document that answers four questions: which channels is the bot working well in, is the automation rate improving over the year, whatβs the trade-off between bot cost and customer satisfaction, and where should the team invest next? You answer with a small, polished analytical report β using everything from the earlier notebooks (variables, control flow, functions, NumPy, pandas, the pandas/seaborn plotting toolkit, scikit-learn) on one coherent business-AI problem. Itβs the very same support-ops bot you automated a weekly report for in NB 46: there you made it run; here you find out what itβs actually doing.
The notebook runs on one mental model β youβre a detective building one case file. The dataset is the crime scene, exploration is dusting for prints, the groupby/pivot_table work is interviewing witnesses, the 2Γ2 dashboard is the evidence board, the latency slopes and clustering are forensics, and the executive summary is your closing argument to a jury (the PM, who has 30 seconds). The forensics section springs the courseβs best statistical trap β twice. The global latency-vs-satisfaction correlation looks damning, but it is aggregation bias: slow channels simply happen to be the low-satisfaction channels, and conditioning on channel makes the association vanish. (Strictly it is not Simpsonβs paradox β that is the sharper case where the within-group sign flips; here the within-group slopes are indistinguishable from zero.) Then the second trap: with twelve points per channel those slopes are underpowered, not absent, and the notebook is explicit that βwe cannot detect itβ is not βit is not thereβ. The defensible lever is still moving volume between channels rather than shaving milliseconds β but it rests on the level differences, not on those slopes.
This is the analytical version of βshipping a projectβ. The deliverable is a document a manager could read in five minutes and take to a meeting β and the notebook is explicit that the 5-bullet summary is the deliverable: everything you compute exists to support it.
Learning objectives / skills exercised:
Build and sanity-check a reproducible dataset (schema, missing values, category balance) before trusting any conclusion
Answer manager questions with
groupby/pivot_table, plusapply-based feature engineering (quarter tags, a bot-economics βhealthβ label)Condense a study into a 2Γ2 executive dashboard (
plt.subplots(2, 2)) worth pasting into a slide deckTest a causal-sounding claim by conditioning on the grouping variable β and tell aggregation bias from Simpsonβs paradox, and underpowered from no effect
Read a treeβs feature importances without mistaking a proxy for a cause (
latency_mstops the ranking only because it identifies the channel)Group channels via a distance matrix over their 12-month automation profiles (K-means in the stretch)
Write a 5-bullet executive summary: one insight per bullet, concrete numbers, actionable
Structure:
Setup
Build the dataset β simulate 5 channels Γ 12 months (60 rows) of support-ops metrics: tickets, automation, latency, CSAT, cost per ticket
Quick exploration β schema, missing values, category balance
Automation analysis β 4.1 which channel automates best Β· 4.2 seasonal grouping (quarter feature via
apply)Cost and satisfaction analysis β 5.1 a bot-economics classifier (qualitative health labels)
The executive dashboard β the 2Γ2 evidence board
A statistical question β does latency hurt satisfaction? (global vs per-channel correlation β aggregation bias, and why n=12 per channel cannot settle it)
Bonus β clustering channels by automation profile (distance matrix)
Your turn β write the executive summary (draft yours, then expand the model answer)
Practice: milestone-driven rather than checkpoint-driven β there are no β quick-exercise cells. The built-in writing task in Β§9 comes with a collapsible model summary; then π§ͺ bonus exercises AβC (add a composite βbot ROIβ column; save the final report with to_csv and reload it; predict satisfaction with a RandomForestRegressor and read the feature importances) and π§ stretch exercises AβB (K-means clustering of the channel profiles; a month-15 linear projection of automation rates), each with a collapsible π‘ solution. Closes with 8 project takeaways.
Datasets: nothing is loaded from disk β Β§2 generates the dataset in-notebook so the capstone is self-contained and reproducible (βin a real project you would load this with pd.read_csv(...) from your operations data warehouseβ). Each of the 60 rows is one (channel, month) observation:
Column |
Meaning |
|---|---|
|
one of 5 channels (Email, Chat, Phone, Web Form, Social) |
|
Janβ¦Dec + 1β12 |
|
total tickets vs tickets resolved by the bot alone |
|
median first-response latency |
|
mean CSAT that month (1β5) |
|
average cost in USD (mix of LLM + human time) |
support_ops_report.csv (in this folder) is the committed reference output of bonus exercises A + B: the final enriched table (60 rows = 5 channels Γ 12 months) including the engineered quarter, health, bot_savings, and bot_roi columns.
48 Β· Capstone B: AI Customer-Feedback Assistant β 48_capstone_ai_assistant.ipynbΒΆ
The engineering twin of NB 47. One concrete artefact carries the whole notebook: an overnight support inbox of 50 raw customer messages β refund complaints, bug reports, feature wishes, praise β that has to be turned, by morning, into a PM-ready report. You build the machine that does it: ingest free-form feedback, classify sentiment + topic as structured LLM output, route high-priority items through a small rules engine, ground answers in your own knowledge base via RAG, and produce a daily report that runs on a schedule with cost tracking and an eval guard. These are the words behind the numbers you analysed in NB 47 β same support operation, the other half of the job.
The mental model here is a factory assembly line for messages: Classify is the stamping press, Validate is quality control, the rules engine is the sorting bins, RAG is the instruction-sheet attacher, and the final station packages everything into a report. Two things run alongside the belt β a trace log (the factoryβs CCTV) and an eval gate (the safety inspector who can shut the line down before a bad batch ships). The notebook opens with an ASCII architecture diagram that literally is the belt, then builds one station per section:
raw feedback βββΊ Classify (LLM, JSON) βββΊ Validate (schema)
β β
βΌ βΌ
Rules engine (priority) RAG: ground answer in docs
ββββββββββββ¬ββββββββββββββ
βΌ
Aggregate + report βββΊ daily executive summary
ββΊ cost / latency / eval trace
The finished artefact is ~250 lines of self-contained Python demonstrating every AI-engineering pattern in the course: a package-shaped daily_run function that refuses to ship a regressed prompt, processes all 50 messages end-to-end, computes a cost/latency/accuracy dashboard from its own trace, saves the trace to disk, and emits a five-bullet executive summary to (mock) Slack β the thing you point to in an interview when asked βwhat AI project have you built?β.
Learning objectives / skills exercised:
Combine prompting, RAG, validation, tracing, and scheduling in one end-to-end pipeline
Classify sentiment + topic as strict JSON, then schema-validate before anything downstream consumes it
Keep business rules in reviewable code β a plain-
ifpriority engine, deliberately separate from the modelGround answers in your own knowledge base so the assistant cites your docs instead of inventing answers
Build a golden eval set and a regression check that gates prompt changes before they ship
Compute a cost / latency / accuracy dashboard from the trace log and write the 5-bullet PM summary
Structure:
Setup β the shared mock infrastructure (an inline, deterministic
MockLLM)The data β 50 incoming feedback messages + a 7-document knowledge base
Step 1 β classify with structured output (strict JSON:
sentiment+topic)Step 2 β validate the structured output before it reaches downstream stations
Step 3 β the priority rules engine (escalate now / handle today / route to product / acknowledge)
Step 4 β RAG for actually answering the question
Step 5 β the full pipeline + tracing (every message records labels, priority, tokens, latency)
The KPI dashboard β priority mix, cost, latency, sentiment, read back from the trace
The executive summary β what a PM actually wants to read
The regression check β would tomorrowβs prompt change still pass the golden set? (10.1 draws the ship/halt gate, so you can see how close you came)
Wiring it all together β a single scheduled task (
daily_run), the night-shift robot from NB 46 running an AI line
Practice: milestone-driven, no β quick-exercise cells. π§ͺ Bonus exercises 1β3 (an English-only filter that overrides priority; VIP-customer routing; baking the daily summary into a report.md β βtrace.csv for engineers, report.md for managersβ) and π§ stretch exercises AβB (a daily cost cap that halts the run and fires a Slack alert; VIP messages that always escalate to p0), each with a collapsible π‘ solution. Closes with βWhat youβve builtβ and five upgrade paths (real provider, embedding retrieval, tool calling, a Streamlit UI, a feedback loop).
Datasets: everything lives in-notebook β the 50-message FEEDBACK list, the 7-document KB, and the 7-example GOLDEN eval set. At runtime the scheduled task writes its trace to /tmp/feedback_reports/trace.csv. This capstone does not use support_ops_report.csv.
How the capstones workΒΆ
Like every notebook in the course, both capstones run 100% offline. Capstone A needs only the standard analytics stack (pandas, NumPy, matplotlib/seaborn, scikit-learn) and generates its own data. Capstone B vendors a deterministic inline MockLLM β the twin of MockLLM from llm_providers.py (NB 28) β so the whole assembly line runs with no internet and no API key, producing the same output every time; when you want real intelligence, one line swaps in OpenAI, Anthropic, Gemini, or a local Ollama model (see the LLM Providers Guide). Unlike the regular lessons, the capstones arenβt punctuated by quick-exercise checkpoints: each numbered section is a milestone that adds one piece to a single shippable artefact, and the π§ͺ bonus and π§ stretch exercises at the end extend that artefact β try each one before expanding its collapsible π‘ solution.
If you have the time, do both β A teaches the analytical mindset, B the engineering mindset, and they analyse the same support operation from opposite sides. If you have to pick one, pick the one that matches the job you want next. In an interview, talk through one of these as your βproject I builtβ: you wrote the code, and you understand every part.
Where nextΒΆ
Congratulations β with NB 1β46 plus these two capstones, the core technical track is complete. One module remains, the practitioner layer:
Module 16 β Business AI in Practice (
../16_business_ai/, NB 49β52) β architecture, governance, and the POC β MVP β Production path for landing AI inside a real organisation.
From there, what you build is up to you.
π No quiz for this module β the two capstones are the assessment (see the quizzes README). Ship both deliverables and youβve passed.