The frameworks, methods, and ethics of deriving valid, novel, and useful knowledge from raw, messy data.
3 units · Blended learning (full online)
Two 10-minute breaks separate the hours; break slides mark each one.
The quizzes and the Hour-3 discussion are graded for engagement, not correctness. Incorrect answers are acceptable.
KDD = Knowledge Discovery in Data. A precise definition of "knowledge discovery," and why it is more than running an algorithm.
The five-stage pipeline from raw data to interpreted knowledge, and why it is iterative.
How the 12 weeks map onto that pipeline, plus tools, logistics, and expectations.
Learning objective: to explain what distinguishes knowledge discovery from computation alone.
The conditions under which a number becomes knowledge. The session returns to this question at the end.
These terms recur throughout the semester. Each is explained again on the slide where it is first used, and all appear in the glossary at the end.
Recorded facts — numbers, text, dates, clicks — before anyone has interpreted them.
e.g. “7/1: 3 sachets kape” in a store’s notebook
A collection of data about one topic, usually arranged as a table.
e.g. two years of clinic appointments, saved as one file
One entry in a dataset: everything recorded about one thing or event. One row of the table.
e.g. one appointment: patient, date, attended or not
One property that every record has — one column of the table.
e.g. age, barangay, number of visits
The data-mining term for an attribute, especially one constructed to help find a pattern.
e.g. “distance to the clinic”, worked out from the address
A cell where nothing was recorded. In code it shows up as NaN (“not a number”).
e.g. a patient with no contact number on file
Memorisation is not required; each term is used later in this session.
A regularity that shows up across many records.
e.g. “no-shows rise on clinic days after heavy rain”
A pattern that has passed four tests — valid, novel, useful, understandable — so someone can act on it.
e.g. “remind far-away patients when rain is forecast”
Knowledge Discovery in Data: the whole multi-step process from raw data to knowledge.
e.g. choose the data, clean it, reshape it, search it, judge the result
The one step inside KDD where a method searches the data for patterns.
e.g. sorting shoppers into groups that buy alike
A fixed recipe of steps a computer follows, the same way every time.
e.g. “sort the list, then take the middle value”
A simplified summary of the data that describes a pattern or predicts an outcome.
e.g. the rule “lives over 4 km away + rain → likely to miss”
A chain of stages where each stage’s output is the next stage’s input.
e.g. raw file → cleaned table → summary → chart
Jeepney GPS pings, GCash payments, weather station readings, and census forms accumulate far faster than anyone can read them.
Storage grows exponentially (doubling again and again); human attention does not. Whatever is not processed into knowledge is effectively lost.
A store notebook that fills a new page every second cannot be read in full, so most of it goes unused without a method for finding what matters.
Sales, payments, enrollments, bookings: deliberately recorded, usually fairly clean, and the classic raw material for data mining.
GPS traces, weather stations, server logs, CCTV: recorded as a side effect, in very large volume, and rarely designed for analysis.
Posts, reviews, news articles, photos: rich in meaning but irregular in structure. Weeks 3–4 cover how to collect it.
Census, surveys, administrative registers. PSA OpenSTAT (the Philippine Statistics Authority’s free online tables) is our recurring example. Curated, documented, but aggregated: already added up into totals, so the individual records are gone.
Only the last category was collected to be analyzed. Most data is exhaust (a by-product of some other activity), which is why preprocessing (cleaning and repairing data before analysis) occupies four weeks of this course.
Identify the quadrant that describes the data in a current research project, for use in the Hour-3 discussion.
| Shape | What it looks like | Example |
|---|---|---|
| Structured | Rows × labeled columns; a schema fixed in advance | Enrollment table, POS sales, OpenSTAT extracts |
| Semi-structured | Tagged and nested, but flexible; the structure is stored with the data | JSON from an API, HTML pages, XML feeds |
| Unstructured | No inherent fields; meaning must be extracted | News articles, complaint emails, photos, audio |
The KDD pipeline's early stages exist largely to convert the bottom two rows into the top one: analysis-ready tables.
Week 3 scrapes semi-structured HTML; Week 10's storytelling starts from structured summaries. This distinction recurs throughout the course.
<p> (Week 3){"name": "Ana", "visits": [3, 5]}Gregory Piatetsky-Shapiro coins “knowledge discovery in databases” for the first workshop on it.
The KDD conference begins; it has run every year since.
Fayyad, Piatetsky-Shapiro and Smyth publish the definition this course uses.
The field becomes an official special-interest group of the ACM.
In the 1960s–80s, “data mining” was a criticism: it meant fishing through data until something looked significant.
KDD names the whole process, from raw data to knowledge; data mining is now mostly used for the step that finds the patterns.
The KDD conference has met every year, and is considered the field’s most influential forum.
of the 1,000+ papers submitted to KDD 2014 were accepted: 151 papers.
Became a positive term around 1990 and is now more common in business and journalism than “KDD”.
Both names describe the same work: turning recorded data into knowledge that someone can act on.
A standard definition, examined one word at a time.
The raw material is now defined: records and attributes in a table. This part examines when a pattern in that table qualifies as knowledge.
"The non-trivial process of identifying valid, novel, potentially useful, and ultimately understandable patterns in data."— Fayyad, Piatetsky-Shapiro & Smyth, "From Data Mining to Knowledge Discovery in Databases," AI Magazine, 1996
Although nearly 30 years old, this remains the reference definition. Each adjective excludes a class of results. Non-trivial means it requires substantial work, not a single lookup or one sum.
KDD is not a single algorithm or query; it is a multi-stage, human-guided process.
Panning for gold, where patterns are the abundant sand and the four highlighted words are the sieve that keeps only the gold (knowledge).
The pattern holds on new data, not only the sample (the part of the data that was studied). Guards against overfitting (learning quirks of this sample that will not repeat) and coincidence.
It reveals something not already known. "Sales rise in December" is valid but not a discovery.
Someone can act on it: a decision, a policy, a product. Usefulness is judged by the domain, not the algorithm.
A person can understand why it holds, immediately or after further explanation. A black-box score (a number from a method whose reasoning cannot be inspected) does not qualify on its own.
A result that fails any one filter is not yet knowledge; it is a lead for further investigation.
Examinations may require evaluating a given "finding" against all four criteria.
A standard textbook example: ice cream sales and drowning deaths rise and fall together month after month. The pattern is strong and the data are real, but the causal claim is false.
Hot weather drives both. A pattern can be statistically real yet invalid as knowledge if it disappears once context is taken into account.
A striking pattern is the start of an examination, not its conclusion. The four filters constitute that examination.
DIKW stands for Data → Information → Knowledge → Wisdom. Each layer adds context and meaning. KDD is the process for moving up the pyramid.
Between data and knowledge: turning recorded facts into actionable patterns.
"7/1: 3 sachets kape · 7/1: 2 load ₱20 · 7/2: 5 sachets kape …" — raw entries in the tindera's notebook, one per sale.
Summarized and contextualized: "Coffee sachet sales double on weekdays before 7 AM."
A validated, actionable pattern: "Commuters buy coffee on the way to work — stock up and open earlier." This is a discovery.
At millions of rows, manual analysis is no longer feasible; KDD is designed for this scale.
Knowing when to trust the pattern (e.g., not during a holiday week). This judgment remains human.
A mall's analytics team reports: "Customers who buy umbrellas are 340% more likely to also buy pancit canton during the same typhoon week. Recommendation: bundle them year-round."
Select an answer, then click and hold (or tap) to show the answer
A — a validity failure.
The pattern is real within typhoon weeks (people stock up on storm supplies together), but the recommendation extrapolates it year-round. Tested on ordinary weeks, it would likely vanish. It is arguably not novel either, but the decisive flaw is the validity of the generalization.
After the break: the five-stage process that turns raw data into defensible knowledge.
Five stages, with repeated iteration.
Part 1 defined what counts as knowledge. This part presents the process that produces it: the pipeline from a raw file to a defensible finding.
Practitioners consistently report that stages 1–3 consume the large majority of project time. Mining itself is comparatively short.
Weeks 3–6 live in stages 1–3; weeks 7–10 in stages 4–5.
KDD resembles cooking a meal: select the ingredients (selection), wash them (preprocessing), chop them (transformation), cook (mining), and taste before serving (interpretation), returning to an earlier step if the result is wrong.
Before any analysis: which data to use, and whether it can be trusted.
Whether the conclusion would change if this field were wrong. If so, the field requires careful cleaning.
The cleaned data is reshaped so that patterns can be found, and the patterns are then extracted.
Classification · regression · clustering · association rules · anomaly detection · summarization
The next slide defines each new term on this slide in plain language.
“A step in the KDD process that consists of applying data analysis and discovery algorithms that, under acceptable computational efficiency limitations, produce a particular enumeration of patterns (or models) over the data.”
| Stage, for the five clinics in this week’s lab | Data mining? |
|---|---|
| 1–2 · choose the clinics; decide what to do with Talamban’s missing visits | no: selection and preprocessing |
| 3 · compute visits per staff member for each clinic | no: transformation |
| 4 · search for clinics whose visits per staff member stand out | yes: an algorithm enumerating patterns |
| 5 · decide whether that pattern is valid, novel and useful | no: interpretation, by people |
KDD is the whole process; data mining is one step inside it.
Analogy (continued): transformation prepares the ingredients and mining applies the recipe suited to the requested dish; a sophisticated recipe cannot compensate for poor preparation.
Apply the four filters: validity on held-out data, novelty, usefulness to the stakeholder, and explainability.
Translate into the stakeholder's language (the person or group who will use the result): charts, narratives, dashboards (screens of live charts). (Weeks 9–10 are devoted to this.)
Most initial findings fail a filter and require a return to earlier stages: reselect, re-clean, re-transform, re-mine.
A pattern that no one understands or acts on is a computation, not a discovery.
A project typically passes through the loop several times, and the schedule should allow for this.
A barangay health center notices many patients miss their follow-up appointments. The captain asks: "Can the data tell us who is likely to miss, so we can send reminders where they matter?"
The example is small and local, and it involves every stage, pitfall, and ethical question in this course. It recurs throughout the semester.
The task is not only "predict no-shows" but "find valid, novel, useful, understandable patterns in who misses and why, so a human can design a better reminder policy."
Each item above is a judgment call that changes the final answer, so these stages cannot be delegated to a script (a file of code) written by someone else.
Dropping rows with missing contacts silently removes the hardest-to-reach patients. This is both a statistical problem and an ethical one.
Engineer features: distance-to-center from address, days-since-last-visit, rainy-season flag, prior no-show count. Raw columns rarely carry the signal; derived ones do.
The analysis begins with simple methods: cross-tabs (counts of one column against another) and a decision tree (a model made of yes/no questions, like a flowchart). Suppose the result is: "no-shows concentrate among patients >4 km away, on clinic days after heavy rain."
Valid: to be checked next quarter. Novel: staff suspected distance, not the rain interaction. Useful: far patients can be rescheduled around forecasts. Understandable: fully.
The loop: the rain finding leads back to Stage 1, since PAGASA rainfall data must now be joined in (matched to each appointment by date), which restarts selection and cleaning for a new source.
Real KDD projects are iterative rather than linear. At least two full passes should be planned.
| Stage | Classic pitfall | Defense |
|---|---|---|
| Selection | Sampling bias: the available data does not represent the claimed population (everyone the study aims to describe) | Identify who is missing from the table, and why |
| Preprocessing | Silent deletion of inconvenient rows | Cleaning journal; report row counts before/after |
| Transformation | Leakage: a feature that implicitly contains the answer | Confirm the value is known before the outcome |
| Mining | Overfitting: memorizing noise as pattern | Hold-out data; prefer simpler models first |
| Interpretation | Claims that exceed the evidence | The four filters, applied in writing |
Each is treated in full in its own week; at this stage only the names need to be recognized.
This table also serves as a review checklist for the final project's methodology section.
| Term | What it names | Relation to KDD |
|---|---|---|
| KDD | The whole discovery process, end to end | The umbrella term; this course |
| Data mining | Pattern-extraction algorithms | Stage 4 of the KDD process |
| Machine learning | Algorithms that improve from data | Supplies many mining tools |
| Data science | The broad discipline & profession | KDD is its methodological core |
| Analytics / BI (business intelligence) | Reporting & decision support in orgs | Consumes KDD outputs |
In industry these terms overlap; this course keeps them distinct in order to state precisely where in the process a problem occurs.
"Data mining" is also used to mean the entire process. Context usually disambiguates, but written work should be precise.
An analyst computes "days until next typhoon" as a feature for predicting appointment no-shows, using PAGASA's after-the-fact storm records. Identify the stage and the pitfall.
Select an answer, then click and hold (or tap) to show the answer
B — transformation-stage leakage.
Feature engineering happens in Stage 3, and "days until next typhoon" uses information that was not available at prediction time. The model would score very well in testing and fail in deployment, which is the characteristic symptom of leakage.
After the break: real applications, a 170-year-old case study, ethics, and course requirements.
Applications and their risks.
Parts 1 and 2 covered the definition and the five stages. This part examines them in practice, where an incorrect finding affects real people.
Market-basket analysis (what gets bought together), churn prediction (which customers are about to leave), credit scoring, fraud detection in e-wallet transactions.
Disease surveillance (tracking cases as they are reported), genomics (DNA data), drug-interaction discovery, outbreak early warning.
Census & poverty mapping (PSA OpenSTAT), disaster response, and data journalism that holds power to account.
In this course, examples and projects lean on open Philippine data — PSA, PAGASA, DOH, and public web sources scraped during the course.
Students may use data from their own field for the final project.
During London's 1854 cholera outbreak, physician John Snow mapped death locations by hand and found that they clustered around the Broad Street water pump, evidence against the prevailing "bad air" theory. The pump handle was removed; the outbreak subsided.
Data collection, cleaning (deaths misattributed to other addresses), a visualization, an inference, an action: the complete KDD loop, 170 years before the term existed.
A dashboard tracking dengue clusters or traffic fatalities applies the method of Snow's map with modern tools. Weeks 9–10 cover building the map and the argument.
The same techniques that map poverty can profile individuals. The Philippines' Data Privacy Act of 2012 (RA 10173) sets legal duties for anyone processing personal data (any information that can identify a person), including researchers.
Privacy law, anonymization (removing names and identifiers) and its limits, algorithmic bias (a method that treats some groups unfairly), and responsible scraping. Ethics is also part of every week, beginning with scraping practice in Week 3.
A telco's analytics team discovers that prepaid users who let their load expire twice in a month are 5× more likely to default on the company's new micro-loan product. They propose auto-rejecting those applicants.
Task: prosecute or defend this as "knowledge" using the four filters and the three ethics questions from earlier.
Two groups present, one prosecuting and one defending, before the course roadmap.
This is intentional: graduate-level KDD requires defending judgment calls publicly.
Twelve weeks along the KDD pipeline.
Part 2 introduced the five stages. This part shows how the twelve weeks cover them one stage at a time, and what the course requires.
| Weeks | Theme | Topics |
|---|---|---|
| 1–2 | KDD foundations | This intro · CRISP-DM, SEMMA & process frameworks |
| 3–6 | Scraping & preprocessing | HTML parsing · APIs & scraping ethics · cleaning · transformation |
| 7–8 | Data exploration | Descriptive statistics · univariate & multivariate EDA · visualization |
| 9–10 | Journalism & storytelling | Finding stories in data · narrative, dashboards & communication |
| 11–12 | Ethics & synthesis | Privacy & responsible analytics · final presentations |
The sequence follows the KDD pipeline from Part 2, applied step by step to real data.
Weekly exercises build toward a final discovery project presented in Week 12.
Blended learning, fully online: recorded lectures + live (synchronous) discussions. 3 units, 3 contact hours/week.
Python (a programming language) and its libraries (bundles of ready-made code): pandas for tables, requests for fetching pages, BeautifulSoup for reading HTML, matplotlib for charts. Jupyter notebooks and this portal.
Graded (GRD): weekly hands-on exercises, a midterm synthesis, and the final discovery project.
No prerequisites are assumed beyond graduate standing, although familiarity with basic Python makes Weeks 3+ easier. The slides explain every line of code they use, one line at a time.
DS 208 (Programming for Data Science) pairs naturally with this course.
| Component | Weight | What it rewards |
|---|---|---|
| Weekly exercises (best 8 of 10) | 40% | Consistent hands-on practice; the two lowest scores are dropped |
| Midterm synthesis (Week 7) | 20% | Integrating scraping → cleaning → exploration on a fresh dataset |
| Final discovery project | 30% | Full KDD cycle on data from the student’s field, defended in Week 12 |
| Participation | 10% | Quizzes, forum activity, discussion contributions |
Project proposals are due in Week 6, so candidate datasets should be evaluated from now on; this week's assignment is the first step.
Standard graded course (GRD). Rubrics for each component are posted on the course page.
The assignment is deliberately small; its aim is to begin viewing familiar settings as data.
Browse PSA OpenSTAT or any open portal in a relevant field. Choose one dataset of genuine interest.
State a question it might answer, and explain which of the four filters (valid, novel, useful, understandable) would be hardest to satisfy.
Installation instructions are on the course page. Code writing begins in Week 3; the weekly labs require no installation because they run in the browser.
The terms dataset, record, attribute, and missing value are now defined. The lab shows how they appear when Python opens a small clinic table, the first step of Stage 2 (preprocessing). The next two slides explain that code line by line. Each block runs in the browser: select ▶ Run / Edit under it (the first run downloads Python, 10 to 20 seconds).
import io, pandas as pdload two libraries (ready-made code): pandas, for tables, and io; as pd gives pandas a short nicknameraw = """…"""a variable (a name that holds a value) called raw, holding the table as plain text: commas between columns, one record per linepd.read_csv(io.StringIO(raw))read that text as if it were a CSV file; the result is a DataFrame, pandas’ table, stored in dfprint(df)show the table underneath the codeNaN is the missing value: Talamban has no visits recorded. Visits show .0 because a column with a gap is stored as decimals.A DataFrame is a spreadsheet controlled with code: each record is a row, each attribute is a named column.
The checks cover size, missing values, and a typical value, using the same df as the previous slide.
df.shapethe size, as (rows, columns): (5, 4) means 5 clinics, 4 attributesdf["visits"]select one column by its name, in square brackets and quotes.isna().sum().isna() marks each missing cell True; .sum() counts the Trues. 1 = one clinic has no visits number.mean() / .median()the average / the middle value. pandas skips the missing cell, so both use 4 clinics.name() is a method: a function (a named piece of work) that belongs to a value, called with a dot and bracketsOne busy clinic (1,240 visits) raises the mean to 623.75; the median, 433.5, stays close to a typical clinic. Analogy: when a millionaire enters a sari-sari store, the average customer’s wealth rises but the middle customer’s does not.
Replace each ____ with an answer, press ▶ Run to see
the output, then press Check. Two multiple-choice questions ask what the numbers
mean.
Guadalupe’s 1,240 visits already pull the mean (623.75) far above the median (433.5). What if it were busier still?
1240 to 3000.Result on the lecture laptop (select to reveal)
The mean jumps to 1,063.75; the median stays at 433.5. One extreme value moves the mean, not the middle.
Valid, novel, useful, understandable — a finding must pass all four.
Five stages with feedback; most of the work happens before mining.
Datasets describe real people; ethics applies before the first stage.
In answer to the opening question: a number becomes knowledge when it passes the four filters and someone can act on it.
Part 1 can be reviewed again, and remaining questions posted to the discussion forum.
NaNraw = "…".mean()Fayyad, U., Piatetsky-Shapiro, G., & Smyth, P. (1996). From Data Mining to Knowledge Discovery in Databases. AI Magazine, 17(3). Short, readable, and the source of this week's definition.
Han, Kamber & Pei, Data Mining: Concepts and Techniques — Ch. 1. · Republic Act No. 10173 (Data Privacy Act of 2012), full text at the National Privacy Commission site.
Readings are linked on the course page alongside this deck.
The Fayyad paper is best read after this lecture, when its concepts are already familiar.
CRISP-DM, SEMMA, and how project teams structure the discovery loop: the project-management framework for the rest of the course.
DS 227 · Knowledge Discovery in Data