CRISP-DM, SEMMA, and the KDD process: project structures that turn unplanned exploration into defensible work.
Knowledge Discovery in Data · University of the Philippines Cebu
The original nine-step academic pipeline (Fayyad, 1996).
The six-phase industry standard used in the lab.
SAS's five-step, tool-centred alternative, and a comparison of the three.
All three describe the same progression, from raw data to a defensible decision.
A checklist against which any analysis, including one’s own, can be assessed.
Each is explained again where it is first used, and all appear in the glossary at the end. Last week’s terms (dataset, record, pattern, model, pipeline…) still apply.
A named, step-by-step plan for running a data project. Also called a framework.
e.g. CRISP-DM, SEMMA, the KDD process
The academic original (Fayyad, 1996): selection, preprocessing, transformation, data mining, interpretation.
e.g. the five-stage pipeline from Week 1
CRoss-Industry Standard Process for Data Mining: six phases in a loop, starting from the question.
e.g. the framework this course runs on
Sample, Explore, Modify, Model, Assess: five steps from the software company SAS.
e.g. starts with data already in hand
One stage of a process model, with its own question and its own output.
e.g. Evaluation asks “could this be wrong?”
The person or group whose decision the analysis serves.
e.g. a town councillor deciding on water testing
Return to an earlier phase, applying what was recently learned.
e.g. Evaluation finds a problem → back to Business Understanding
One line each here; Part 2 gives each phase its own slide.
Phase 1: identify whose decision the analysis serves and the exact question that would settle it.
e.g. “did the monthly fail rate rise after May?”
Phase 2: examine the data: what each column means, and what looks unusual.
e.g. noticing the testing lab changed in May
Phase 3: the decisions that turn raw rows into an analysable table.
e.g. what to do with a month that has no samples
Phase 4: choose and compute the summary or model that answers the question.
e.g. the average fail rate per lab
Phase 5: check whether the result answers the question, and how it could be wrong.
e.g. “did the water change, or only the lab?”
Phase 6: put the result into real use, usually a sentence someone acts on.
e.g. a two-line note to the council, caveat included
A count divided by what it is out of, often × 100 to make a percentage.
e.g. 9 failing out of 38 samples = 23.7%
A third factor that changes together with the variable under study and can produce a false pattern.
e.g. a new testing lab, the same month the rate jumped
Knowledge discovery is the non-trivial extraction of valid, novel, useful patterns from data. This week covers the process that finds such patterns while avoiding self-deception.
Definition → discipline. A definition specifies the destination; a framework specifies the order of steps and where errors commonly occur.
Steps performed out of order produce a confident answer to a question no one asked.
Companies including Daimler, NCR and Teradata want a shared way to run data projects.
It becomes a European Union research project.
Presented at a workshop in Brussels and published as a guide.
IBM releases ASUM-DM, which refines and extends CRISP-DM.
Its authors made it neutral about industry and software, which is why it has outlived most of the tools of its time.
CRISP-DM stands for Cross-Industry Standard Process for Data Mining: one plan meant to work for a bank, a hospital or a carmaker alike.
SourceWikipedia: CRISP-DM; Wirth & Hipp (2000)
The most-used method in KDnuggets polls of 2002, 2004, 2007 and 2014.
Not tied to any industry, software or kind of data.
The six phases organise this course’s lab work.
SEMMA, from the software company SAS, is the main alternative; Part 3 compares the two.
SourceWikipedia: CRISP-DM (citing the KDnuggets polls)
"Without a destination, any route is acceptable, and none can be justified."The failure mode a framework exists to prevent
A named process lets a colleague, or the original analyst six months later, retrace the steps.
Each stage produces an artefact (a tangible output: a table, a chart, a note) that someone can check before the next stage builds on it.
When a stakeholder (whoever the analysis is for) raises an objection, the analyst can identify where a choice was made.
Fayyad, Piatetsky-Shapiro & Smyth, 1996: the source of the field's vocabulary.
The five stages were introduced last week. This part revisits them as a process model and shows that data mining is only one of them.
The term "data mining" is often used for the entire project. In the KDD paper it is a single stage, the algorithm run, surrounded by considerably more work.
Selecting, cleaning, transforming, mining, and interpreting, from end to end.
The pattern-finding step. It is powerful, but its output is unreliable if the preceding stages were done poorly.
The data becomes smaller and cleaner from left to right. What is discarded is as consequential as what is kept.
The process rarely runs straight through; beginners often omit the loop back.
| Stage | Input | Output |
|---|---|---|
| Selection | Everything recorded | The target subset worth studying |
| Preprocessing | Target data, including its flaws | Cleaned data: missing values, noise handled |
| Transformation | Clean rows | Features — reduced, encoded, scaled |
| Data mining | Features + a goal | Patterns: rules, clusters, a model |
| Interpretation | Raw patterns | Knowledge that supports action |
Little of this consists of "running the algorithm": four of the five stages are preparation and interpretation.
A pattern is not knowledge until a human decides it is valid and useful.
Starts with a hypothesis (a specific, testable guess) and tests it, for example whether a difference is real or due to chance.
Machine learning: methods that learn a rule from examples to predict the next case. One tool in the mining step.
The complete search for useful patterns, using both of the above and the surrounding stages.
KDD is the umbrella; statistics and ML are two tools under it. Confusing a tool with the process leads projects to proceed directly to modelling.
The instruction "run a model" names a step, not a plan.
A charge made in two cities minutes apart is held, based on a pattern mined from millions of normal transactions.
Vital signs trending toward a known danger pattern trigger an alert to a nurse before a crisis.
"Because you watched…" recommendations apply a pattern discovered across all users' histories to one user.
None of these is only "a model." Each is a full KDD pipeline: a question, messy data, preparation, a method, and a final decision.
Raw records in, a defensible decision out. This structure underlies the whole course.
"We used data mining to find the pattern." Which KDD stages does that sentence quietly skip?
D — all of them.
"We ran the algorithm" omits the four stages that determined what data the algorithm received. Most errors occur in those stages.
Press and hold (or focus) the box to show the answer.
When a project reports "data mining," the relevant question is what happened before the algorithm ran.
The Cross-Industry Standard Process for Data Mining, used in this week's lab.
Part 1 covered the academic five-stage pipeline. CRISP-DM adds two phases it omits: a first phase for the question and a last phase for using the answer.
CRISP-DM was written in the late 1990s by companies managing many one-off analytics projects, which needed a shared, tool-agnostic method for running them. It remains the most widely used framework in industry.
Designed to apply equally to a bank, a hospital, or a water utility.
Does not prescribe Python, R (another programming language), or a spreadsheet; it structures the thinking.
Surveys repeatedly rank it the most-followed data-science process.
A process model for data mining projects: six phases (business understanding, data understanding, data preparation, modelling, evaluation, deployment), each with defined tasks and outputs, run as a cycle rather than once.
| Phase | In this week’s water-testing example |
|---|---|
| 1 · Business understanding | a checkable question: did failures really rise after April? |
| 3 · Data preparation | computing fail_rate, and deciding what August’s 0 of 0 means |
| 5 · Evaluation | testing the conclusion against the change of lab in May |
| back to 1 | the finding sends the analyst back to the question |
Source: Chapman, Clinton, Kerber, Khabaza, Reinartz, Shearer & Wirth (2000), CRISP-DM 1.0: Step-by-step data mining guide (paraphrased).
The outer ring represents the project. The arrow from Evaluation back to Business Understanding is the key feature: one pass is rarely enough.
The purpose of the loop is to change what someone does, not to produce a notebook.
CRISP-DM is a cooking cycle: identify the diners (business), check the pantry (data), wash and chop (preparation), cook (modelling), taste (evaluation), and serve (deployment); a poor result leads back to the menu.
Before any number is computed: whose decision the analysis serves, and what would change the answer. This phase is the most often skipped and the most costly to skip. “Business” means whoever the work is for: a town, a clinic, a school.
The requirement is established before any analysis; a correct answer to a question no one asked is still a failure.
"Is our water getting worse?" expresses a concern; "Did the monthly fail rate rise after May?" can be checked.
The result that would count as an answer is decided before it is seen; otherwise any finding can be rationalised.
The data is examined before it is trusted: every column, what each one means, and any anomalies that would invalidate naïve conclusions.
The contents and labels of the data are verified before the analysis is planned around them.
A rise from 6% to 25% failures has a mundane explanation and an alarming one. Both are initially hypotheses.
If the measuring lab switched in the same month the numbers rose, the numbers may not be comparable.
"Preparation is not cleaning for appearance. It is a series of decisions, each of which changes the answer and each of which must be defensible."This week's lab, on the phase that takes 60–80% of a real project
The options are drop, fill, or flag. A month with zero samples is not a month with zero failures.
Letting a library (ready-made code, like pandas) decide how to
handle 0/0 (zero divided by zero, which has no answer) is still the analyst’s choice, made silently.
Averaging ten months across two different labs may answer no real question at all.
Preparation is slow, but it affects the result more than the choice of model does.
"Modelling" need not mean machine learning. It means choosing the summary that answers the question; sometimes a grouped average (one average per group, e.g. per lab) is the whole model.
The simplest method that answers the question is often preferable, because every step can be explained.
Grouping fail rates by lab answers whether the labs differ, which is a different question from whether the water changed.
An explainable summary is preferable to an unexplainable model. Complexity is justified only when the question requires it.
Evaluation checks whether the result answers the Phase-1 question and how it could be wrong. The analyst challenges the conclusion before anyone else does.
A cook tastes before serving and checks whether an odd flavour comes from the soup or from the tasting spoon (the measurement).
Specify one observation that would show the water genuinely worsened.
If a stricter threshold (the cut-off level that counts as a fail) at the new lab explains the jump, the water may not have changed at all.
Usually a sentence someone acts on, not a model in production (running automatically inside a real system). A discovery has effect only once it reaches the person making the decision.
The result must reach the decision-maker, together with a statement of its limitations.
And, equally clearly, what is not yet supported.
Hedging should not be so heavy that nothing is said, and certainty should not exceed the evidence.
Decision owner and question.
Examine it; find anomalies.
Decisions that shape the answer.
The summary that answers it.
Checks for error.
A sentence someone acts on.
This slide is the structure of this week's lab.
Evaluation often leads back to Phase 1 with a sharper question.
| Month | Samples | Fails | Fail rate | Lab |
|---|---|---|---|---|
| April | 40 | 2 | 5.0% | A |
| May | 38 | 9 | 23.7% | B |
| June | 41 | 10 | 24.4% | B |
| July | 39 | 9 | 23.1% | B |
| August | 0 | 0 | — | B |
Fail rate = fails ÷ samples × 100: the percentage of samples that failed. The apparent conclusion is that failures tripled after April; the phases check whether it is correct. (The lab uses a longer, ten-month version of this table with the same problems.)
August has zero samples, which means no data, not zero failures. This distinction determines the whole analysis.
Business Understanding converts the concern "Is the water worse?" into a test with a yes-or-no answer.
"Did the mean monthly fail rate rise after April?": a quantity that can be computed and defended.
A rise from ~5% to ~24% would count as real only if nothing else about the measurement changed.
fail_rate = fails / samples. Valid for April–July. For August it is 0 / 0, which is undefined: no percentage can be assigned to 0 out of 0.
Recording August as 0% invents a perfect month. Dropping it acknowledges that the value is unknown. Only the second is honest.
This one line, keeping only rows where samples > 0, distinguishes an honest table from a flattering one.
The lab asks for this guard (a check that stops bad rows getting through) and an explanation of why the default answer would mislead.
No machine learning is involved, only a grouped average, which answers a different question from the one posed.
| Lab | Months | Mean fail rate |
|---|---|---|
| A | April | 5.0% |
| B | May–July | 23.7% |
The rise coincides exactly with the switch from Lab A to Lab B, so "the water got worse" now has a competing explanation.
"The failure rate quadrupled in the month a new lab took over the testing. The measuring instrument must be ruled out before the water is blamed."Evaluation examines the obvious explanation critically
A confound is a third factor that moves with both. Here it is the lab change: a new measurer can shift the measurement without any real change.
Confirming the trend requires months from Lab B before May, or from Lab A after. The table contains neither.
Here deployment is not a server but the sentence given to the town: claim, number, and the caveat that keeps it accurate.
"Measured fail rates rose from ~5% to ~24% after April — but a lab change in May confounds it, so this is a flag to investigate, not proof the water worsened."
Without it, the report may raise a false alarm or miss a real one. The honest statement is the deliverable.
The lab switch could explain the entire rise.
New question: "Does the water differ, holding the lab fixed?"
Obtain comparable months: same lab, before and after.
For this reason CRISP-DM is drawn as a circle. Completing one cycle does not end the project; it identifies the right question.
A good evaluation usually creates further work; this is the intended behaviour of the process.
After the break: a comparison of CRISP-DM with a competing framework.
SAS's five-step process, deliberately narrower in scope.
Part 2 covered CRISP-DM’s six phases. This part adds a third framework and compares all three side by side to show what each omits.
Take a workable slice of the data.
Visualise; identify patterns and anomalies.
Clean, transform, engineer features.
Fit the pattern-finding method.
Judge how well it holds up.
Developed within SAS Enterprise Miner (a commercial data-mining program from the company SAS), it maps directly onto the software's analysis nodes (the boxes connected on its point-and-click screen).
It starts at Sample, not at a question. This omission is the central point of debate.
SEMMA is a cooking-competition round that starts with the ingredients provided and ends at the judges’ tasting, without asking who the meal is for or serving it.
It is deliberately limited to the technical core. This makes it concise, but risky if its omissions are overlooked.
SEMMA assumes someone already framed the problem. CRISP-DM makes that Phase 1.
It ends at "Assess." Turning the result into action is outside the scope of the acronym.
| KDD process | CRISP-DM | SEMMA |
|---|---|---|
| — | Business Understanding | — (missing) |
| Selection | Data Understanding | Sample + Explore |
| Preprocessing + Transformation | Data Preparation | Modify |
| Data Mining | Modelling | Model |
| Interpretation / Evaluation | Evaluation | Assess |
| Use of knowledge | Deployment | — (missing) |
The middle rows align closely: the frameworks agree on the technical work.
CRISP-DM surrounds the core with purpose (top) and action (bottom), which explains its continued use.
It opens at Sample, which assumes data is already available, and closes at Assess. It includes no purpose and no follow-up action, which is a hidden risk.
Starting at Sample allows a flawless model of the wrong question.
Ending at Assess can leave a strong result unused in a notebook.
For the technical middle, SEMMA's five steps are concise and repeatable, provided the middle is not mistaken for the whole.
| Situation | Framework | Reason |
|---|---|---|
| A stakeholder with a vague request | CRISP-DM | It requires the purpose first |
| Data already in hand, iterating fast | SEMMA | Tight modelling loop |
| Explaining the field to a newcomer | KDD process | Names every transformation |
They overlap far more than they differ. A framework is scaffolding; the best choice is the one that prevents the analyst from skipping the step most likely to be skipped.
Most working teams use an informal blend and rarely name a framework explicitly.
An analyst drops the August row because it has zero samples. Which CRISP-DM phase is this?
B — Data Preparation.
Deciding what to do with a broken row (drop, fill, or flag) is preparation. It is a judgment call that must be defensible, not a tidy-up.
Naming the current phase clarifies what kind of decision is being made.
Every choice about a row or column belongs to Preparation, and every one changes the answer.
The frameworks are not alternatives to choose between. CRISP-DM structures the project; SEMMA's concise verbs suit the technical middle; KDD's vocabulary names the stages precisely.
It is the most complete and the most widely understood, and this course uses it.
Its value lies in catching a step that would otherwise be skipped, usually Phase 1 or Phase 5.
The common claim that "80% of data science is cleaning data" is not a complaint; cleaning is the phase where the answer is decided.
A project should be judged by its preparation choices, not by its algorithm.
The tempting sequence is to open the notebook (a document of text and runnable code), load the CSV (a plain-text table file), and fit something (let a model learn from the data). It appears to be progress but produces a confident answer to a question no one asked.
A polished result that cannot be linked to any required decision.
The first hour should be spent in Phases 1 and 2 without code, as the framework requires.
A team reports "fail rate rose from 6% to 25% after May." What CRISP-DM phase most needs revisiting before they publish?
B — Data Understanding.
If the measuring lab switched the same month, the before and after numbers may not be comparable. The analysis should return to this phase before any claim is made.
The water dataset in this week's lab contains this exact problem.
When a number changes sharply, check what else changed at the same time.
The lab takes one small water-quality dataset through all six phases. It requires almost no code: the reasoning is the work. ~45 minutes.
A month with zero samples, a lab that switched mid-year, and three different "averages" that each tell a different story.
Two honest sentences for a councillor: what the data shows, and what cannot yet be claimed.
The Week 1 lab opened a table and counted its gaps. This week’s lab adds a new column (the fail rate) and makes Data Preparation choices about a month with no data. The next two slides read 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).
pd.read_csv(io.StringIO(raw))read the ten-month table (typed as text in the variable raw) into a DataFrame, pandas’ table, called waterwater["samples_failing"] / water["samples_taken"] * 100divide one column by another, row by row, then × 100: the fail rate as a percentagewater["fail_rate"] = (…).round(1)store the answer as a new column named fail_rate, rounded to 1 decimalwater.iloc[3:8]show rows by position: 3 up to, not including, 8 (April to August; positions count from 0)NaN (missing), not 0One line of pandas works on a whole column at once, like filling a formula down a spreadsheet column.
Two ways to average the same fail_rate column.
water["fail_rate"].mean().mean() is a method (a function that belongs to a value, after a dot). pandas skips NaN by default, so it averages the 9 months that have data.fillna(0)first fill every missing cell with 0, treating August as a perfect monthround(…, 1)a function (a named piece of work) that rounds the number in its brackets to 1 decimalLeaving an unmarked exam out of the class average is honest; writing 0 on it changes the average and records something that never happened.
The lab asks for the guard to be written explicitly (keep only months where samples were taken), so the choice is visible in the code instead of hidden in a default. Fill each ____, press
▶ Run, then press Check.
The honest choice keeps only the months that have data, instead of counting August as 0%.
water["lab"] == "Regional". How many months now, and what mean?Result on the lecture laptop (select to reveal)
9 of 10 months kept, mean 16.8: the same as .mean(), which skips August’s NaN. Regional only: 6 months (August among them, still NaN), mean 25.2, against 6.2 for the Municipal lab’s four months.
Repeatable, reviewable, and traceable to the decision that was made where.
Six phases in a loop. Business Understanding comes first; Deployment is the purpose.
60–80% of the work, and every choice changes the result.
They share a technical core and differ in whether they include purpose and follow-up action.
Main point: a framework prevents the analyst from skipping the step that decides the answer.
Phase 1 (framing) or Phase 5 (checking for error).
.mean()Wirth & Hipp (2000), CRISP-DM: Towards a Standard Process Model for Data Mining — the paper that named the six phases.
Fayyad, Piatetsky-Shapiro & Smyth (1996), §2: the KDD pipeline covered in Part 1.
Both are linked on the course page beside this deck and the lab.
The reading is easier to follow after the lab has applied the six phases to realistic (invented) data.
Web fundamentals and HTML parsing: how raw data is obtained before this process can begin.
DS 227 · Knowledge Discovery in Data