The whole knowledge-discovery process in one view, and the final presentations.
Knowledge Discovery in Data · University of the Philippines Cebu
Twelve weeks, one pipeline, reviewed end to end.
The project workbench: expectations, dataset choice, and assessment criteria.
Presenting a finding in eight minutes and a Q&A.
Week 1 described a full process: from a question, through raw and messy data, to a result others can trust. The final project applies that process independently.
The project requires only tools already covered in the course, by design.
The fixed order of steps that turns raw data into an answer: load, prepare, explore, communicate.
e.g. one notebook that runs all four, top to bottom
Getting the data into Python as a working table.
e.g. df = pd.read_csv("flood.csv")
Correcting problems before analysis: types, missing values, outliers, joins, and privacy.
e.g. turn text dates into dates; drop the name column
Summarising and charting the data to find patterns, then checking them.
e.g. describe(), a histogram, a correlation
Turning one checked finding into a sentence, a chart and a talk that others can trust.
e.g. a finding-title with its number and its limit
Another person can rerun the work from the start and get the same numbers.
e.g. Restart & Run All finishes with no errors
Where the data came from: who collected it, when, why, and under what licence.
e.g. "DPWH export via the BetterGov.ph mirror", plus the download date
A plain statement of what the data or method cannot show.
e.g. "no outcome column, so I cannot say if flooding fell"
Work that is submitted and graded.
e.g. the notebook, the written claim, the talk
The list of criteria against which work is marked, with what earns full marks.
e.g. defensibility, correctness, method, communication, ethics
A finding written as four sentences: the finding, its number, the method, the limit.
e.g. the week-9 template
How big the question is. A good scope is one sentence with the exact columns named.
e.g. not "analyse education" but "completion vs teachers per pupil, Region VII"
Able to survive a sceptical reader: every number traced to code, every limit stated.
e.g. "80.8% complete (n=34,079)", not "almost all complete"
A checked finding that there is no clear difference or relationship. Still a result.
e.g. "completion rates do not track budget size"
A classmate checks the work before submission, looking for omissions.
e.g. "which sentence goes further than the evidence?"
Clearing the notebook's memory, then running every cell from the top: the definitive test that it works.
e.g. Colab: Runtime → Restart and run all
The content of twelve weeks, assembled.
Each step was introduced in a separate week. This part arranges them into one workflow, load → prepare → explore → communicate, which the project follows.
Weeks 1–2 · KDD & CRISP-DM: the question comes first.
Weeks 3–4 · Scraping, APIs, and collection etiquette.
Weeks 5–6 · Gaps, outliers, merges, one honest table.
Weeks 7–8 · Description, charts and correlation.
Weeks 9–11 · Findings, dashboards, ethics.
Read left to right, it is the project plan; each stage corresponds to a week of this course, by design. (KDD, knowledge discovery in data, is the course's name for the whole line.)
CRISP-DM (week 2's standard project cycle) also has arrows that go backward: exploration reveals preparation flaws, and findings reopen the question. Revisiting earlier steps is normal.
| Step | In plain words | Tools used | Common error |
|---|---|---|---|
| Load | Get the data into a table and look at it | pd.read_csv, an API, a scraper; shape, head() | A column that looks full but is empty (amount_paid) |
| Prepare | Fix types, gaps, outliers and joins; remove what identifies people | to_datetime, isna(), merge, drop | A cleaning step that quietly deletes a whole group |
| Explore | Summarise and chart; look for a pattern, then try to break it | describe(), groupby, histograms, corr() | A summary that silently skipped rows |
| Communicate | One checked finding, as a sentence and a chart, with its limit | finding-titles, sorted bars, the four-sentence claim | A verb stronger than the evidence ("proves", "causes") |
Cooking involves buying ingredients (load), washing and chopping (prepare), tasting (explore) and serving (communicate), and good plating cannot compensate for skipped preparation.
The question is written first (weeks 1–2). Each step is chosen according to what that question needs.
The dataset used throughout the course.
| Week | Technique | Error it revealed |
|---|---|---|
| 4 | APIs, JSON, pagination | amount_paid is 0 on every row — unpopulated, not unpaid |
| 5 | Missing data, outliers | dropna() removed 25.6% of rows and every unfinished project |
| 6 | Joins, types, derived columns | A project that finished 17 days before it started |
| 7 | Descriptive statistics | describe() silently excluded 6,415 rows |
| 8 | Correlation, visualisation | r = −0.785 between latitude and longitude |
| 9 | Data journalism | A ₱75.2B headline the data could not support |
| 10 | Storytelling, dashboards | A partial year drawn as a 47% collapse |
| 11 | Ethics, privacy | One rounded column made 30.9% of records unique |
Eight techniques, each with a characteristic error. The errors were central to the syllabus. The techniques appear in every textbook; knowing where each one misleads is the main skill acquired.
This is the actual pipeline, shortened here, not a summary. It runs in about a second and reproduces every number in the course.
Load, convert, check, derive, summarise, relate, protect. The order matters, and the course has shown why each step precedes the next.
pd.read_csv(path)load: read the CSV file into a DataFramepd.to_numeric(..., errors="coerce")turn text into numbers; anything unreadable becomes NaN (missing) instead of an error(df.completion_date - df.start_date).dt.daysdays between two dates (the full script first converts both columns with pd.to_datetime, week 6)df.isna().sum()how many missing cells in each column... and the # w7-8 linessteps left out to fit the slide; each is a week's labIf any of those numbers ever disagrees with a slide, the slide is wrong. This is the value of reproducibility: not elegance, but the ability to be corrected. Reproducible means anyone can rerun the script from the start and get these same numbers.
| Line | What it means |
|---|---|
amount_paid unique [0] | Every row holds 0: the column was never filled in, so it says nothing about payment |
naive dropna() 25,370 (25.6% lost) | dropna() deletes any row with an empty cell; a quarter of the data went |
completed, after drop 99.6% | Unfinished projects have no end date, so dropping gaps dropped them: 80.8% became 99.6% |
budget skew 5.13 | Skew above 0 means a long right tail: most budgets are small, a few are huge |
pearson / spearman 0.365 / 0.508 | Two correlation scores (week 8): 0 = no relationship, 1 = perfect; bigger budgets tend to take longer |
unique at 50M bands 0.4% | With ₱50M budget bands and region instead of province, 0.4% of projects stand alone (week 11) |
Each line reduces one week's lesson to a checkable number. The $ in $ python pipeline.py is the terminal's prompt and is not typed.
The next two slides are the script behind the run, cut into weeks 4–7 and 8–11. Every number on the “one run” slide comes out of this code, and the companion notebook runs it end to end.
The browser cannot download the data, so these blocks have no Run button.
text = requests.get(url, …).textkeep the downloaded text: the bug two slides on reads it a second way(34079, 15)34,079 projects, 15 columnsdf.dropna()week 5’s naive drop: a quarter of the rows go, and the completion rate jumps to 99.6%df["duration"] = …week 6’s derived column; one project is impossibledescribe()["count"]week 7: 27,664 durations, so 6,415 rows were silently left outr, rhoweek 8: Pearson 0.365 against Spearman 0.508 for budget and durationc.head(48).sum() / c.sum()week 9: the top 1% of contractors hold 27.6% of the moneyalone(cols)week 11: the share of projects alone in their group, before and after generalisingThe first run of that script reported 27,664 rows surviving dropna(). Week 5 had said 25,370. One of them was wrong.
csv.DictReader(f)Python's built-in CSV reader: each row becomes a dictionary of text''an empty string: text with nothing in it. It is a value, so dropna() keeps itpd.read_csv(f)pandas' reader: an empty cell becomes NaN, the missing-value marker, which dropna() removescsv.DictReader leaves an empty field as ''; pd.read_csv makes it NaN. Only the second is dropped, so the loader changed the answer.
This table is a project reference. Every row was practised in the labs.
r.json()clipmerge / concatgroupby / pivot_table| Task | Tools |
|---|---|
| Fetch data | requests, BeautifulSoup, r.json() |
| Audit & clean | isna().sum(), IQR fences, clip |
| Combine & shape | merge, concat, groupby, pivot_table |
| Explore | describe, histograms, corr, scatters |
| Communicate | small multiples, sorted bars, finding-titles |
| Protect | k-anonymity audit, banding, suppression |
Status code before body. Row counts around merges. describe() before
belief. Plots before conclusions.
Drop vs fill, keep vs cap, blur vs publish: every choice logged and defensible.
Association not causation; number and caveat in the sentence; titles that report.
Polite requests, purpose-bound data, no group-of-one statistics, bias named in the report.
Libraries change; these habits do not. An analyst with these habits is reliable with any toolset.
The final project is graded on these four habits.
| Check | From | Cost |
|---|---|---|
.unique() on the column the claim rests on | w4 | 5 seconds |
| Row count before and after every filter | w5 | 2 lines |
| Range check on every derived column | w6 | 1 assert |
count compared to len(df) | w7 | 1 line |
| Relationship recomputed within groups | w8 | 1 groupby |
| Verb matched to the evidence | w9 | 1 reading |
| k computed before release | w11 | 1 groupby |
None takes more than a minute. Together they distinguish a reliable analysis from one that is right by chance. All seven should be run on the project before presentation.
assertassert (df.duration >= 0).all().unique()At the start of the course, a 34,000-row government dataset was only an object of reading. Students can now analyse one and state what it does and does not support.
Many people who work with data never learn the second half, the limits, which is what makes the first half trustworthy.
A classmate's project: totals doubled after a merge, the "average" is quoted without spread, the headline says "proves", and one barangay's mean covers a single student. How many weeks of this course did that violate?
B: all four can be diagnosed from one paragraph.
Unexplained row growth (week 6's merge audit), centre without spread (week 7), "proves" from observational data (week 9), and a group-of-one statistic (week 11). The ability to name these failures is a central outcome of the course.
The same diagnostic applies to one's own project, before others apply it.
Work is reviewed as strictly as the course's toughest grader would, then submitted.
The whole pipeline, a chosen dataset, a chosen question.
Part A reviewed the whole workflow. This part applies it to a chosen dataset: selecting the data, sizing the question, and the required submissions.
A scaffold rather than exercises: four sections that mirror the pipeline, each with TODOs to replace with real work and answer cells for written findings.
The question, the data's provenance, and an honest first look
(shape, head, info).
Gaps, outliers, merges and reductions, with every decision documented as it is made.
Univariate → multivariate → the central comparison → one honest chart and one defensible sentence.
The aim is the most defensible analysis, not the most impressive.
The most common project failure is a dataset that cannot answer any relevant question, discovered only in week three. Point 4 is the data's provenance: where it came from.
Before committing, load it and write down one question it could answer. If none exists, it is the wrong dataset, however interesting it appears.
The scope is how big the question is. The project spans weeks, not months. A complete small analysis demonstrates every skill in this course; an ambitious unfinished one demonstrates none.
The question can be stated in one sentence, with the exact columns that answer it named. If either is vague, the scope needs narrowing.
Runs top to bottom after Restart & Run All. Every decision has a comment saying why, not what.
Finding, number, method, limit — four sentences, the week-9 template.
Three beats, three charts, eight minutes. The week-10 structure.
Each is a deliverable: work that is submitted and graded. Disagreement among the three, such as one number in the notebook and another on the slide, is the most damaging finding a reviewer can make. Charts are regenerated from the notebook, never by hand.
The due date, submission method and presentation slots are on the course page. If anything there differs from this deck, the course page wins.
| Criterion | What earns full marks |
|---|---|
| Defensibility | Every claim traceable to a computation; limits stated without being asked |
| Correctness | The seven checks were run; the notebook reproduces the numbers shown |
| Method | Cleaning decisions justified, not merely performed; denominators stated |
| Communication | Titles state findings; charts labelled; three beats, not fifteen charts |
| Ethics | Provenance given; privacy considered if personal; no claim beyond the evidence |
A rubric is the list of criteria against which work is marked. Some items are not on this list: novelty, technique count, dataset size. A careful analysis of 400 rows outscores a careless one of four million.
| Criterion | In plain words | Self-check… |
|---|---|---|
| Defensibility | Every stated number can be found in the notebook, and the limits of the data are stated before anyone asks | Pointing at each number on the slides and finding the cell that computed it; reading the limit sentence aloud |
| Correctness | The numbers are right, and rerunning gives the same ones | Restart & Run All, then comparing every figure on the slides with the notebook; running the seven checks |
| Method | The reason for each cleaning step is stated, with "out of how many" (the denominator) for every figure | Finding a comment with a reason beside every drop or fill; checking the "of what" behind every percentage |
| Communication | A new reader understands the point from the titles and charts alone | Pasting the chart titles into a blank page to see whether they read as a summary; a five-second look by a friend |
| Ethics | The data source is given, any people in it are protected, and no claim exceeds the evidence | Publisher, date and licence under the chart; a k-audit (week 11) if people are in it; checking every verb (week 9) |
The weights of each criterion are not in this deck; they are on the course page. What the table promises is the direction: defensibility first.
The right-hand column serves as a final checklist. Every completed row corresponds to marks already secured.
The project requires many hours with the data. Local data (transport, weather, prices, sports) sustains interest and allows informed checks.
Weeks 4 and 11 apply in full: a permitted source, no personal data that cannot be protected, and a k-audit before sharing.
Enough rows to hold structure (hundreds+), small enough to understand every column. Complexity is not a rubric item.
Suitable sources: PSA and open-data portals, city open records, public APIs from week 4, or a page that passes the week-3 scraping checks.
If loading the data takes a week, a different dataset is needed.
The existence of an API is not the same as a successful download. The download is tested before committing to the question.
The source and the right to republish must be stated. Both belong in the method section.
It is downloaded immediately. A portal that 403s scripted clients or serves a broken XLSX is a project-ending problem in week three.
Without a column dictionary, the meaning of fields must be guessed, and week 4 showed the consequences.
Publisher, date accessed, licence. Without those three, the method cannot be written.
The flood dataset passed all three, which is why the course used it. The upstream DPWH portal returns 403 to scripted clients; the mirror made it usable, and knowing that difference is itself part of the provenance.
A modest finding, cleanly derived, honestly caveated, and reproducible end-to-end ranks above a spectacular claim with an unreliable pipeline.
Runtime → Restart and run all. If it completes top-to-bottom on a fresh kernel (the Python program behind the notebook, with its memory wiped), others can retrace the work. This is why it is §4's last checkbox.
Sample size, confounders (a third factor that moves both things, week 8) that could not be ruled out, and who the data misses: naming them shows competence.
The workbench recommends it; git (a tool that saves every version of a set of files; each saved version is a commit) makes progress and process visible.
| When | Done by then | Error it avoids |
|---|---|---|
| Now | Question written; dataset loaded; seven checks run | Discovering in week 3 that the data cannot answer it |
| +1 week | Cleaning decisions made and written down | Re-deciding the same thing three times |
| +2 weeks | The finding computed; the four-sentence claim drafted | Having analysis but no argument |
| +3 weeks | Three charts, titles as sentences; rehearsed once aloud | Building slides the night before |
| Before submission | Restart & Run All on a fresh kernel | A notebook that runs on only one machine |
The finding is due at the two-thirds mark. The last third is for communicating and checking it, which carries most of the marks and is most often compressed.
Peer review means a classmate checks the work before submission. Projects are exchanged. The reviewer's task is not encouragement but finding the assumptions the author cannot see.
An unstructured request for opinions produces "looks good". Specific questions produce findings.
The concern is usually unfounded, and the remedy is not to seek a more dramatic story.
A null result is a checked finding that there is no clear difference or relationship. "Completion rates do not differ meaningfully across regions" is a finding. It is checkable and useful, and it scores higher than a dramatic claim that could not be verified.
Novelty is not on the rubric. A careful null result meets every criterion that is.
A relationship that is absent overall may be strong within groups. Week 8: budget vs duration ranged 0.09 to 0.62 by region.
Counts hide rates. Region III looks dominant by total and ordinary per project.
"No relationship", with what was checked and the power available (how likely the data was to detect an effect if one existed; more rows, more power), is a complete result.
Starting over in the final week does not work. A finished, honest analysis of a modest question ranks above an unfinished one of an exciting question, by design.
Eight minutes to establish trust in a finding.
Week 10 covered data storytelling. This part applies it to the final talk: its outline, its timing, and the questions afterwards.
The question and why it matters. No pipeline talk yet.
Data source, the two hardest preparation decisions, and their reasons.
The finding: the strongest chart, with a finding-title and the number in the sentence.
Limits, the next check, and implications for action.
One chart per point, every title a finding, every claim matched to its caveat. The slides should pass the five-second test a panel applies. These four add up to 7 minutes, leaving one spare; the official slot is on the course page.
The one-sentence finding, with its number, should be recallable without preparation, even at 3 a.m.
The talk follows the week-10 structure. The timing below is what fits eight minutes. It is the same talk as on the previous slide, with "the check" (the attempt to refute the finding) given its own beat.
Silent rehearsal is always faster than delivery. The first spoken version should not be in front of the class.
Most questions can be anticipated. For the one that cannot, an honest answer matters most.
"How did you handle missing data?", "Could it be something else?", "How many rows?" — all three should be answered with numbers.
| Failure | How it shows up | Prevention |
|---|---|---|
| No question | A tour of the dataset with no argument | Question written before the data is examined |
| Numbers that disagree | The slide says 27,664; the notebook says 25,370 | Every figure generated from the notebook |
| Unstated denominator | "the average" — of what population? | Every figure gets its n |
| Claim exceeds evidence | A causal verb on correlational data | Verb checked; week 9 |
| Cannot be rerun | Fails on a fresh kernel or another machine | Restart & Run All before submission |
A denominator is the "out of how many"; a causal verb ("causes", "drives", "leads to") claims more than a correlation can show. The second row, numbers that disagree, is the most damaging and the easiest to avoid. It is also the bug that appeared while writing this session’s own synthesis script.
A panel probes the same points the course taught students to check: merges, caveats, confounders, privacy. These questions should be asked in advance.
The three weakest points are listed before the talk. Two will likely be asked, and answers can be drawn from the list.
"I don't know; this is how I would check" is a strong answer. Improvised certainty is weak.
"With only ten weeks of data…" from the presenter indicates rigor. From the panel first, it indicates an oversight.
Each of these has occurred in past presentations. None concerns the analysis, and all cost limited time.
Live notebooks can fail during a talk. A PDF of the three charts always opens.
Comments concern either the analysis or the communication. They need different responses, and conflating them wastes both.
Argument cannot create understanding. If a reader missed the point, the chart or sentence failed, regardless of whether the analysis was right.
| Check | Verification |
|---|---|
| Notebook runs top to bottom | Restart & Run All, on another machine if possible |
| Every figure on a slide comes from the notebook | All regenerated and compared with the pasted versions |
| Every number has its n | Each figure on the slides checked for its "of what" |
| The limit is stated, unprompted | It should appear before anyone asks |
| Sources cited: publisher, date, licence | Under the chart, not in an appendix |
| No data or secrets committed | git ls-files; note that .gitignore does not untrack |
Six checks. They apply the discipline of the seven analytical checks to the artifact instead of the data. They should be run the day before, not the hour before.
git ls-files.gitignoreThis course supplies what models need: clean tables, scaled features, honest evaluation. ML courses begin where week 6 ended.
Weeks 9–10 extend into a discipline of their own: dashboards, visual essays, decision support.
When the pipeline must run every night at scale, the same stations become systems: ingestion, warehouses, orchestration.
The discovery discipline applies in every branch, and it is difficult for employers to teach during onboarding.
Twelve working notebooks form a self-written reference library for later use.
This course was designed as a foundation, and later courses assume its content.
Statistics before machine learning. A model fit on unexamined data only produces errors faster.
Even pandas rewrites its own rules between versions: pandas 3 changes how copies of a table behave. Libraries move; the questions do not.
Asking what a column records and what a step excluded works on any dataset, in any language, indefinitely.
Many people who produce charts have never asked either question.
At the start of the course, the ₱1.17 trillion headline (week 9: "completed but never paid", resting on an empty column) would have appeared to be a scoop. Knowing why it was not, and checking in five seconds, summarises the course.
One sentence, with the columns named. Show it to someone before writing any code.
All of them, now. Finding an error today is better than the night before.
Finding, number, method, limit. Even if the number is provisional.
On paper, with titles as full sentences. A chart that cannot be titled does not yet show a finding.
The aim for today is a question, a loaded dataset and three chart titles. That is most of the work; the rest is execution.
A notebook computes 25,370 surviving rows. The slide says 27,664. What is the correct response?
csv.DictReader (empty fields stay '') while the original used pd.read_csv (empty fields become NaN), so dropna() removed different rows. A discrepancy is information: it showed that the loader changed the answer. Discrepancies are never reconciled by choosing one value.Discovery is directed by a question, not accidental.
In fetching, cleaning and merging, which receive little attention but are where errors arise.
Claim, number, caveat; everything else is supporting material.
Collect with care, protect thoroughly, and publish only what could be defended to the people described.
In one sentence: knowledge discovery is a chain of small honest decisions that ends in a result others can trust.
The final presentations complete the course.
''assertThank you for twelve weeks of careful work. The pipeline can now be applied to questions that matter.
DS 227 · Knowledge Discovery in Data · University of the Philippines Cebu