📚 Chapters

⛏️ Data Mining

Unit 1 — Introduction, Machine Learning & Data Review

⛏️Chapter 1 — Introduction to Data Mining
⛏️ CHAPTER 1 — INTRODUCTION TO DATA MINING MIND MAP
Basics → Data → Information → Knowledge
Definition → Discovering useful patterns from large data (also called KDD)
Goals / tasks → Description and prediction: classification, regression, clustering, association, outlier detection
Stages → Cleaning → integration → selection → transformation → mining → evaluation → presentation
Related fields → Machine Learning, DBMS, OLAP, Statistics

1. Before We Start — Basic Words

📖 Start here. These simple words will appear again and again. Read them once and the rest becomes easy.
WordSimple meaningExample
DataRaw facts and numbers, without explanation25, "Delhi", ₹4000
DatabaseAn organised store of data on a computerA shop's record of all bills
DatasetA collection of data used for one taskA table of 1000 customers
Record (row)One item or person in the dataOne customer
Attribute (column)One property of the item (also called feature or variable)Age, income, city
PatternA repeated, useful regularity hidden in dataPeople who buy milk often buy bread
ModelA formula or rule built from data to explain or predict"Marks = 41.5 + 7.5 × hours"
AlgorithmStep-by-step method a computer followsk-means, decision tree
KnowledgeInformationData
DataRaw facts. Bill: milk × 2, bread × 1, ₹90.
InformationData with meaning. "500 packets of milk sold this week."
KnowledgeA useful pattern. "Milk and bread are bought together, so keep them close."

2. What is Data Mining?

📖 Data mining is the process of discovering useful patterns, relationships and knowledge from large amounts of data, using methods from statistics, machine learning and databases.
💡 Analogy: gold mining. A miner digs tonnes of soil (data) to find a few gold pieces (useful patterns). We do not mine data itself. We mine knowledge out of data.
KDD (Knowledge Discovery in Databases) is the full journey from raw data to knowledge. Data mining is the main step in the middle. Many books use the two names for the same thing.
Normal database query (SQL)Data mining
QuestionYou already know what to askYou do not know what to look for
Example"How many bills were above ₹500?""Which groups of customers behave alike?"
OutputExact stored dataNew patterns and predictions
Real-life examples
Shopping sites"Customers who bought this also bought…"
BanksSpot unusual transactions (fraud)
HospitalsPredict disease risk from reports
Streaming appsSuggest movies you may like
Why now? Today we collect huge data (phones, shops, web), storage is cheap and computers are fast. Humans cannot read all of it, so we let computers find patterns.

3. Data Mining Goals and Tasks

📖 Goals: Data mining has two main goals. Description = understand what is in the data. Prediction = use known data to guess unknown or future values.
Descriptive (understand)Predictive (guess)
QuestionWhat is happening? Which groups exist?What will happen? What class is this?
TasksClustering, association rules, outlier detectionClassification, regression
Needs labels?NoYes (past examples with answers)
ClassificationPut an item in a category. Is this email spam or not?
RegressionPredict a number. What will the house price be?
ClusteringMake groups of similar items. Customer segments.
AssociationFind things that occur together. Milk and bread.
Outlier detectionFind unusual items. A fraud transaction.

4. Stages of the Data Mining Process (KDD Steps)

📖 The process: Data mining is not one click. It is a sequence of stages, and the output of each stage is the input of the next.
1 Data cleaning→2 Data integration→3 Data selection→4 Data transformation→5 Data mining→6 Pattern evaluation→7 Knowledge presentation
The 7 stages explained
  1. Data cleaning: remove noise and errors, fill missing values
  2. Data integration: combine data from many sources (shop, website, app) into one place
  3. Data selection: pick only the data relevant to the question
  4. Data transformation: convert data into a suitable form (normalization, summarising)
  5. Data mining: apply algorithms to find patterns
  6. Pattern evaluation: keep only the patterns that are truly interesting and correct
  7. Knowledge presentation: show results with charts and reports so people can use them
💡 Supermarket example: Collect bills from all branches (integration) → remove duplicate and wrong bills (cleaning) → choose last year's bills (selection) → list items per bill (transformation) → find items bought together (mining) → keep strong rules only (evaluation) → show a report to the manager (presentation).
Same idea, other name: The CRISP-DM model has 6 phases: business understanding → data understanding → data preparation → modelling → evaluation → deployment.

5. Related Technologies — Machine Learning, DBMS, OLAP, Statistics

📖 Data mining stands on four supports. Each field gives it something.
DataMiningStatisticsMachine LearningDBMSOLAP
FieldWhat it isWhat it gives to data mining
StatisticsScience of collecting, summarising and analysing data using numbers and probabilityMeasures (mean, variance), sampling, tests to check a pattern is real
Machine LearningAlgorithms that learn from data and improve with experienceThe algorithms: decision trees, clustering, neural networks
DBMS (Database Management System)Software that stores, organises and retrieves data (e.g. MySQL)The clean, organised data to mine, and fast access with SQL
OLAP (Online Analytical Processing)Quick multidimensional summaries of data (totals by region, product, month)A summarised view of data to explore, before deeper mining
OLAPData mining
StyleUser asks, system summarisesSystem discovers by itself
OutputTotals, averages, comparisonsHidden patterns, predictions
ExampleTotal sales in each city last quarterWhich customers will stop buying next quarter?

6. OLAP in a Little More Detail

📖 OLAP shows data as a cube with several dimensions so managers can look at the same numbers from many angles. OLTP is the opposite: everyday small transactions (one bill, one bank transfer).
SalesProduct →Time →Location
A cube has three dimensions (Product, Location, Time). Each small cell stores a number, for example the sales of one product in one city in one month.
OLAP operationMeaningExample
Roll-upGo to a higher level of summaryCity totals → country total
Drill-downGo to more detailYear → quarter → month
SliceFix one dimension, take one layerOnly the year 2025
DicePick a sub-cube using several dimensions2025, Delhi and Mumbai, phones and laptops
Pivot (rotate)Turn the cube to see another viewSwap rows and columns

7. Role of Statistics in Data Mining

📖 Statistics gives us the tools to describe data and to check whether a pattern is real or just luck.
RoleHow statistics helpsExample
Describe the dataMean, median, mode, spread (variance, standard deviation)Average spend of a customer is ₹800
SamplingStudy a small, fair part instead of all dataCheck 5000 bills instead of 5 crore
Find relationshipsCorrelation and regressionAd spend and sales rise together
Test patternsHypothesis tests, confidence levels: is it chance?Is the new offer really increasing sales?
Handle noise and outliersSpot values far from the restA bill of ₹10 lakh in a small shop
Evaluate modelsMeasure error and accuracyHow often does the spam filter err?
In short: Without statistics, data mining may report patterns that are only accidents. Statistics turns raw numbers into reliable, meaningful information.
🤖Chapter 2 — Machine Learning and EDA
🤖 CHAPTER 2 — MACHINE LEARNING AND EDA MIND MAP
Machine learning → Computer learns patterns from examples
Supervised → Labelled data → classification, regression
Unsupervised → No labels → clustering, association
EDA → Explore data with summaries and charts before modelling

1. Machine Learning — The Basics

📖 Machine learning (ML): A way to make computers learn from examples instead of giving them fixed rules.
💡 Analogy: A child sees many mangoes and apples and learns which is which. Nobody wrote a rule. ML does the same with data.
Old way: Data + Rules→Computer→Answers
ML way: Data + Answers→Computer learns→Rules (model)
TermMeaningExample
FeatureInput property used to decideArea, bedrooms
Label / targetThe answer we want to predictHouse price
Training dataExamples the model learns fromPast house sales
Test dataNew examples to check the modelHouses not used in training

2. Supervised and Unsupervised Learning

📖 Supervised learning: Learn from data that already has the correct answers (labels). Like studying with an answer key.
📖 Unsupervised learning: Data has no answers. The computer finds structure by itself. Like sorting a pile of unknown coins into groups.
SupervisedUnsupervised
DataLabelled (input + answer)Unlabelled (input only)
GoalPredict the label for new dataDiscover groups or patterns
TasksClassification, regressionClustering, association
ExampleMail marked spam / not spam → detect new spamGroup customers by buying habits
FeedbackCompare with the known answerNo answer to compare
Other types: semi-supervised (few labels) and reinforcement learning (learn by rewards and penalties).

3. Regression and Classification Techniques

📖 Regression: Predict a continuous number.
📖 Classification: Predict a category (class label).
Regression: a numberClassification: a classstudy hours → markstwo classes, one boundary
Left: the line predicts marks from hours (a number). Right: the dashed boundary separates two classes (a label).
RegressionClassification
OutputA number (₹, °C, marks)A class (yes/no, spam/not spam)
Key characteristicFits a curve or line to data pointsDraws boundaries between classes
Common techniquesLinear, polynomial, ridge, lasso regressionDecision tree, k-NN, Naive Bayes, logistic regression, SVM
Error measureDifference from the true number (e.g. MSE)Accuracy, precision, recall
Example 1Predict house price from areaDetect spam email
Example 2Forecast next month's salesPredict if a loan will default
Worked example: simple linear regression
Hours (x)Marks (y)
150
255
365
470
580
Finding the line y = a + b·x
  1. Means: x̄ = 3, ȳ = 64
  2. b = Σ(x − x̄)(y − ȳ) / Σ(x − x̄)² = 75 / 10 = 7.5
  3. a = ȳ − b·x̄ = 64 − 7.5 × 3 = 41.5
  4. Model: marks = 41.5 + 7.5 × hours. For 6 hours: 41.5 + 7.5 × 6 = 86.5 marks
Which one to use? Ask: "Is the answer a number or a category?" Number → regression. Category → classification. (Details of each technique come in Unit 2.)

4. Clustering and Association

📖 Clustering: Put similar items in the same group and different items in different groups, without labels.
Clustering: groups found without labels✕✕✕✕ = centre of each group
💡 Example: A shop groups customers into "bargain hunters", "regular buyers" and "big spenders" and plans offers for each group. A well-known method is k-means (Unit 2).
📖 Association rule mining: Find rules like {milk} → {bread}: customers who buy milk also buy bread. Famous use: market basket analysis.
BillItems
T1bread, milk
T2bread, butter, milk
T3bread, butter
T4butter, milk
T5bread, milk
📐 Support and confidence for the rule milk → bread
Support = bills with milk and bread ÷ all bills = 3/5 = 60%
Confidence = bills with milk and bread ÷ bills with milk = 3/4 = 75%
Meaning: 75% of milk buyers also bought bread. A good rule has high support and high confidence.
Applications of association rule mining
  • Market basket analysis: place bread near butter, make combo offers
  • Recommendation: "frequently bought together" on shopping sites
  • Medical diagnosis: symptoms that occur together with a disease
  • Web usage mining: pages visited together, to improve a website

5. Exploratory Data Analysis (EDA)

📖 EDA: Looking closely at the data with numbers and charts before building any model, to understand its shape, find mistakes and spot patterns.
💡 Analogy: Before cooking, you check the vegetables: fresh, rotten, how many. EDA is checking the data before mining.
Steps of EDA
  1. Understand each column: meaning and type
  2. Compute summary numbers: mean, median, mode, minimum, maximum, spread
  3. Check for missing values and duplicates
  4. Draw charts: histogram, box plot, scatter plot, bar chart
  5. Find outliers and relationships between columns
  6. Decide what to clean or change
HistogramBox plotScatter plotoutlierDraw charts first. They show patterns, errors and outliers.
ChartShowsUse
HistogramHow values are spreadShape of one numeric column
Box plotMedian, quartiles, outliersSpot unusual values
Scatter plotRelation of two numbersSee a trend or cluster
Bar chartCounts of categoriesCompare groups
HeatmapColour grid of valuesCorrelation between many columns
Why visualization is important in EDA
  • People understand pictures much faster than tables of numbers
  • Charts reveal outliers, gaps and errors that summary numbers hide
  • They show relationships and trends between columns
  • They help choose the right model and clean the data
  • They make results easy to explain to non-technical people
Anscombe's quartet: four datasets have almost the same mean, variance and correlation, but look completely different when plotted. Only charts show the difference.
📐 Example: why numbers alone can mislead
Data: 4, 8, 6, 5, 3, 8, 9, 5, 7, 50 (sorted: 3, 4, 5, 5, 6, 7, 8, 8, 9, 50)
Mean = 10.5 but median = 6.5. The value 50 drags the mean up
Q1 = 5, Q3 = 8, IQR = 3. Fences: 0.5 to 12.5
50 is outside the fences, so it is an outlier. A box plot shows it as a dot instantly
📊Chapter 3 — Review of Statistical Methods and Data
📊 CHAPTER 3 — STATISTICS AND DATA REVIEW MIND MAP
Statistics review → Mean, median, mode, variance, standard deviation, correlation
Types of data → Structured, semi-structured, unstructured | Nominal, ordinal, interval, ratio
Data quality → Accuracy, completeness, consistency, timeliness
Pre-processing → Cleaning, integration, transformation (normalization), reduction
Matrix → Rows and columns, operations and properties

1. Basic Statistics Review

MeasureMeaningFormula
MeanAverageΣx / N
MedianMiddle value after sorting (not affected by outliers)Middle item
ModeMost frequent valueMost repeated
VarianceAverage squared distance from the mean (spread)σ² = Σ(x − μ)² / N
Standard deviationSquare root of variance, same unit as dataσ = √σ²
Correlation rHow two columns move together: +1 together, −1 opposite, 0 noner = Σ(x − x̄)(y − ȳ) / √[Σ(x − x̄)² Σ(y − ȳ)²]
📐 Example
Data 2, 4, 4, 4, 5, 5, 7, 9: mean = 5, variance = 4, standard deviation = 2
Hours vs marks (earlier example): r = 75 / √(10 × 570) = 0.993, a very strong positive relationship
Population formulas divide by N. For a sample, variance divides by N − 1.

2. Types of Data

📖 A dataset is a table: each row is one object (record) and each column is one attribute. Data can be grouped in two ways.
A. By structure
StructuredSemi-structuredUnstructured
FormatFixed rows and columnsTags or keys, flexibleNo fixed format
Stored inRelational database, spreadsheetJSON, XML, HTML, emailFiles: text, images, audio, video
Easy to search?Very easy (SQL)MediumHard, needs special tools
ExampleBank account tableWeb page, JSON from an appPhotos, WhatsApp voice notes, reviews
Compare structured and unstructured: Structured data has a fixed schema, is small to medium in size and easy to analyse. Unstructured data has no schema, is the largest share of today's data and needs text, image or audio processing before mining.
B. By attribute type (what a column contains)
TypeMeaningExampleWhat you can do
NominalNames or categories, no orderColour, city, genderCount, mode
OrdinalCategories with orderLow / Medium / High, ratingsRank, median
IntervalNumbers, equal gaps, no true zeroTemperature in °C, yearAdd, subtract, mean
RatioNumbers with a true zeroHeight, income, ageAll maths, ratios
Nominal→Ordinal→Interval→Ratio
Left to right: each type carries more information and allows more mathematics.
Another split: discrete (counts: 0, 1, 2…) and continuous (any value: 36.7). Other data kinds: time series, spatial (maps), graph (social networks), transaction data.

3. Data Quality

📖 Data quality tells how good the data is for its use. Rule: garbage in, garbage out. Bad data gives bad results, even with the best algorithm.
DimensionQuestion it asks
AccuracyAre the values correct?
CompletenessIs anything missing?
ConsistencyDo values agree everywhere (same format, no contradiction)?
TimelinessIs the data up to date?
BelievabilityDo users trust it?
InterpretabilityIs it easy to understand?
ProblemExampleEffect
Missing valuesAge is blankModel cannot use that record
Noise / errorsAge = 230Wrong patterns
OutliersOne bill of ₹10 lakhDistorts averages
DuplicatesSame customer twiceCounts become wrong
Inconsistency"M" and "Male", "Delhi" and "delhi"Same thing treated as different
IDNameAgeGenderIncomeCity
1Amit25M40000Delhi
2Neha(missing)F52000Delhi
3Raj230Male38000delhi
4Amit25M40000Delhi
5Sita31F−5000Mumbai
6Pooja28F60000Mumbai
Red cells show problems: missing age, impossible age (230), "Male" vs "M", "delhi" vs "Delhi", duplicate row 4, negative income.

4. Data Pre-processing

📖 Data pre-processing: Preparing raw data so that mining gives good results. Real data is dirty, so this stage often takes most of the time of a project.
Raw data→Clean→Integrate→Transform (normalize)→Reduce→Ready for mining
TaskWhat it doesExamples
Data cleaningFix errors, missing values, duplicates, inconsistenciesFill with mean or median, remove duplicates
Data integrationMerge data from many sourcesJoin shop and website customer tables
Data transformationChange form or scaleNormalization, aggregation, discretization
Data reductionMake data smaller but keep the meaningRemove columns, sampling, PCA
1. Data cleaning
ProblemHow to handle
Missing valuesIgnore the record, fill with mean / median / mode, use a constant, or predict the value
Noisy dataBinning (smooth using neighbours), regression, find and remove outliers
DuplicatesDetect matching rows and keep one
InconsistencyUse one format and one spelling (M/F, Delhi)
IDNameAgeGenderIncomeCity
1Amit25M40000Delhi
2Neha(missing)F52000Delhi
3Raj230Male38000delhi
4Amit25M40000Delhi
5Sita31F−5000Mumbai
6Pooja28F60000Mumbai
IDNameAgeGenderIncomeCity
1Amit25M40000Delhi
2Neha28F52000Delhi
3Raj28M38000Delhi
5Sita31F46000Mumbai
6Pooja28F60000Mumbai
After cleaning: duplicate removed, missing or impossible values filled with the median (age 28, income 46000), labels made consistent.
2. Normalization (scaling)
📖 Normalization rescales numeric columns to a common range, so a column with big numbers (income) does not overpower a column with small numbers (age).
📐 Methods
Min–max: v′ = (v − min) / (max − min), gives values from 0 to 1
Z-score: v′ = (v − mean) / standard deviation, gives mean 0
Decimal scaling: v′ = v / 10j, where j is the smallest integer so that every |v′| < 1
IncomeMin–maxZ-score
400000.09-0.89
520000.640.60
380000.00-1.14
460000.36-0.15
600001.001.59
Min = 38000, max = 60000, mean = 47200, population standard deviation = 8060.
💡 Decimal scaling: largest income 60000 → j = 5 gives 0.6 (less than 1), so v′ = v / 105.
PairDistance on raw valuesDistance after min–max
Amit (25, ₹40000) and Ben (26, ₹41000)10000.027
Amit and Chris (60, ₹40500)5010.875
Raw values say Chris is closer to Amit (501 < 1000), only because income has big numbers. After scaling, Ben (age 26) is correctly closer than Chris (age 60).
3. Other transformation and reduction ideas
  • Aggregation: daily sales → monthly sales
  • Discretization: age → young / adult / senior
  • Encoding: city names → numbers (one-hot)
  • Dimensionality reduction: keep fewer columns, e.g. PCA

5. Matrix and Its Properties

📖 Matrix: A rectangular table of numbers with m rows and n columns (size m × n). A dataset is naturally a matrix: rows = records, columns = attributes.
AgeIncome (thousand)
Customer 12540
Customer 22852
Customer 33138
A 3 × 2 matrix: 3 customers, 2 attributes.
TypeMeaning
SquareRows = columns
Row / column matrixOnly one row / one column
Identity (I)1 on the diagonal, 0 elsewhere. A·I = A
ZeroAll entries 0
DiagonalNon-zero only on the diagonal
SymmetricA = Aᵀ
📐 Operations
Addition: same size, add matching entries
Scalar multiplication: multiply every entry
Multiplication: (m × n)(n × p) = (m × p); row × column
Transpose Aᵀ: swap rows and columns
Determinant of [a b; c d] = ad − bc
Inverse A⁻¹: exists only if det ≠ 0, and A·A⁻¹ = I
PropertyStatement
Commutative additionA + B = B + A
Associative(AB)C = A(BC)
Multiplication is not commutativeAB ≠ BA (usually)
Transpose of a product(AB)ᵀ = BᵀAᵀ
Worked example: A = [1 2; 3 4], B = [0 1; 1 0]
  1. AB = [1·0+2·1, 1·1+2·0; 3·0+4·1, 3·1+4·0] = [2 1; 4 3]
  2. BA = [3 4; 1 2], so AB ≠ BA
  3. det A = 1·4 − 2·3 = −2
  4. A⁻¹ = (1/−2)·[4 −2; −3 1] = [−2 1; 1.5 −0.5]
Where matrices are used: regression (solving for coefficients), PCA (eigenvalues), recommendation systems (user × item matrix).
Note: the syllabus line is partly unreadable in the copy. It is taken here as "types of data, data quality, data pre-processing, matrix and its properties".
⚡Ready for Exam?Sab padh liya? Ab Quick Revision karo — definition, example aur diagram ek jagah!Quick Revision Karo →
⚡Quick Revision — Last Minute Exam Prep!
📌 How to use: Har topic mein pehle Definition, phir Example, phir Diagram hai.

⛏️ Chapter 1 — Introduction to Data Mining

1. Data, Information, Knowledge
📖 Definition: Data = raw facts, information = data with meaning, knowledge = useful pattern.
💡 Example: Bill → "500 milk packets sold" → "milk and bread go together".
KnowledgeInformationData
DataRaw facts. Bill: milk × 2, bread × 1, ₹90.
InformationData with meaning. "500 packets of milk sold this week."
KnowledgeA useful pattern. "Milk and bread are bought together, so keep them close."
2. What is Data Mining
📖 Definition: Discovering useful patterns from large data (KDD is the full process).
💡 Example: Shopping site: "customers who bought this also bought…".
DescriptiveClustering, association, outliers
PredictiveClassification, regression
3. Stages (KDD)
📖 Definition: Cleaning → integration → selection → transformation → mining → evaluation → presentation.
💡 Example: Supermarket bills → find items bought together → report to manager.
1 Data cleaning→2 Data integration→3 Data selection→4 Data transformation→5 Data mining→6 Pattern evaluation→7 Knowledge presentation
4. Related Technologies
📖 Definition: Statistics (tests), Machine Learning (algorithms), DBMS (storage), OLAP (summaries).
💡 Example: OLAP: total sales per city. Data mining: which customers will leave?
DataMiningStatisticsMachine LearningDBMSOLAP
5. OLAP
📖 Definition: Multidimensional view of data as a cube. Operations: roll-up, drill-down, slice, dice, pivot.
💡 Example: Year → quarter → month is a drill-down.
SalesProduct →Time →Location
A cube has three dimensions (Product, Location, Time). Each small cell stores a number, for example the sales of one product in one city in one month.

🤖 Chapter 2 — Machine Learning and EDA

1. Supervised vs Unsupervised
📖 Definition: Supervised: labelled data. Unsupervised: no labels.
💡 Example: Spam detection (supervised). Customer groups (unsupervised).
SupervisedUnsupervised
TasksClassification, regressionClustering, association
LabelsYesNo
2. Regression vs Classification
📖 Definition: Regression predicts a number. Classification predicts a class.
💡 Example: marks = 41.5 + 7.5 × hours → 6 hours = 86.5 marks.
Regression: a numberClassification: a classstudy hours → markstwo classes, one boundary
Left: the line predicts marks from hours (a number). Right: the dashed boundary separates two classes (a label).
3. Clustering and Association
📖 Definition: Clustering makes groups. Association finds items bought together.
💡 Example: Milk → bread: support 60%, confidence 75%.
Clustering: groups found without labels✕✕✕✕ = centre of each group
📐 Formulas
Support = (bills with A and B) / (all bills)
Confidence = (bills with A and B) / (bills with A)
4. EDA
📖 Definition: Studying data with numbers and charts before modelling.
💡 Example: Data with 50: mean 10.5, median 6.5, outlier found by IQR fences.
HistogramBox plotScatter plotoutlierDraw charts first. They show patterns, errors and outliers.

📊 Chapter 3 — Statistics and Data Review

1. Types of Data
📖 Definition: Structured, semi-structured, unstructured. Attribute types: nominal, ordinal, interval, ratio.
💡 Example: Bank table (structured), JSON (semi-structured), photos (unstructured).
Nominal→Ordinal→Interval→Ratio
Left to right: each type carries more information and allows more mathematics.
2. Data Quality
📖 Definition: Accuracy, completeness, consistency, timeliness, believability, interpretability.
💡 Example: Age 230, blank age, "M" vs "Male", duplicate row.
IDNameAgeGenderIncomeCity
1Amit25M40000Delhi
2Neha(missing)F52000Delhi
3Raj230Male38000delhi
4Amit25M40000Delhi
5Sita31F−5000Mumbai
6Pooja28F60000Mumbai
Red cells show problems: missing age, impossible age (230), "Male" vs "M", "delhi" vs "Delhi", duplicate row 4, negative income.
3. Cleaning and Normalization
📖 Definition: Cleaning fixes errors. Normalization puts columns on one scale.
💡 Example: Min–max: (v − min)/(max − min). Z-score: (v − mean)/σ.
IncomeMin–maxZ-score
400000.09-0.89
520000.640.60
380000.00-1.14
460000.36-0.15
600001.001.59
Min = 38000, max = 60000, mean = 47200, population standard deviation = 8060.
PairDistance on raw valuesDistance after min–max
Amit (25, ₹40000) and Ben (26, ₹41000)10000.027
Amit and Chris (60, ₹40500)5010.875
Raw values say Chris is closer to Amit (501 < 1000), only because income has big numbers. After scaling, Ben (age 26) is correctly closer than Chris (age 60).
4. Matrix
📖 Definition: m × n table of numbers. AB ≠ BA. Inverse exists if det ≠ 0.
💡 Example: A = [1 2; 3 4]: det = −2.
📐 Remember
(m × n)(n × p) = (m × p)
det [a b; c d] = ad − bc
(AB)ᵀ = BᵀAᵀ
📄Previous Year Questions
📝 Mid Semester Test-1 (2026-27)
Program: BE/CSE/IT
Subject: Data Mining (24CST-381 / 24ITT-381)
Semester: 5  ·  Time: 1 Hour  ·  Max Marks: 20
Section A: 5 × 2 = 10 marks  ·  Section B: 2 × 5 = 10 marks
Attempt all questions

Section A — 2 Marks Questions

2M2026-27
Q1. Outline the sequence of stages in a typical data mining process. [CO1 | BT2]▼
Answer:
Stages of a typical data mining process (KDD)
  1. Data cleaning (remove noise, fill missing values)
  2. Data integration (combine sources)
  3. Data selection (pick relevant data)
  4. Data transformation (normalize, summarise)
  5. Data mining (apply algorithms to find patterns)
  6. Pattern evaluation (keep interesting patterns)
  7. Knowledge presentation (reports, charts)
1 Data cleaning→2 Data integration→3 Data selection→4 Data transformation→5 Data mining→6 Pattern evaluation→7 Knowledge presentation
2M2026-27
Q2. List any two applications of Association Rule Mining. [CO2 | BT1]▼
Answer:
Association rule mining finds items or events that occur together, written as A → B. Two applications:
  • 1. Market basket analysis: a supermarket finds that customers who buy milk also buy bread (support 60%, confidence 75% in our example), and places them together or offers combos.
  • 2. Recommendation systems: shopping and streaming sites suggest "frequently bought together" items or videos watched together.
Others: medical diagnosis (symptoms and diseases), web usage mining.
2M2026-27
Q3. Discuss the role of statistics in extracting meaningful information from data. [CO2 | BT2]▼
Answer:
Role of statistics: It provides the tools to describe, analyse and validate data, so that mining gives meaningful information.
  • Describe data with mean, median, variance
  • Sample a large dataset fairly
  • Find relationships (correlation, regression)
  • Test whether a pattern is real or just chance
  • Detect noise and outliers, and measure model error
2M2026-27
Q4. Interpret the importance of data visualization in EDA. [CO1 | BT2]▼
Answer:
Data visualization shows data as charts (histogram, box plot, scatter plot). It is a core part of EDA because:
  • People grasp patterns in pictures much faster than in tables
  • It reveals outliers, missing gaps and errors
  • It shows trends and relationships between columns
  • It guides cleaning and model choice
  • It makes results easy to explain
Anscombe's quartet: four datasets with the same statistics but very different plots.
2M2026-27
Q5. Compare structured and unstructured data. [CO2 | BT2]▼
Answer:
StructuredUnstructured
FormatFixed rows and columns (schema)No fixed format
Stored inRelational database, spreadsheetFiles, data lakes
ExamplesBank table, student marksImages, video, audio, emails, social posts
SearchingEasy with SQLHard, needs text or image processing
Share of dataSmallLargest share of data today

Section B — 5 Marks Questions

5M2026-27
Q6. Apply regression and classification techniques to different data mining scenarios. Demonstrate their use by identifying their key characteristics and selecting two appropriate examples where each technique can be effectively employed. [CO1 | BT3]▼
Answer:
Regression predicts a continuous number. Classification predicts a class label. Both are supervised learning (they learn from labelled data).
Regression: a numberClassification: a classstudy hours → markstwo classes, one boundary
Left: the line predicts marks from hours (a number). Right: the dashed boundary separates two classes (a label).
RegressionClassification
OutputNumberCategory
Key characteristicsFits a line or curve, measures error (MSE)Draws boundaries between classes, measures accuracy
TechniquesLinear, polynomial, ridge, lassoDecision tree, k-NN, Naive Bayes, SVM, logistic regression
Example 1House price from area, rooms and locationSpam detection of emails
Example 2Sales forecast for the next monthLoan default prediction (yes / no)
Mini demonstration (regression)
  1. Hours 1–5 → marks 50, 55, 65, 70, 80
  2. Line: marks = 41.5 + 7.5 × hours
  3. A student studying 6 hours: 86.5 marks predicted
Choosing: numeric answer → regression, category answer → classification.
5M2026-27
Q7. Analyze the roles of normalization and data cleaning in improving the quality of a customer dataset before performing data mining tasks. [CO1 | BT4]▼
Answer:
Data cleaning fixes errors. Normalization puts numeric attributes on one scale. Both improve quality before mining.
IDNameAgeGenderIncomeCity
1Amit25M40000Delhi
2Neha(missing)F52000Delhi
3Raj230Male38000delhi
4Amit25M40000Delhi
5Sita31F−5000Mumbai
6Pooja28F60000Mumbai
Red cells show problems: missing age, impossible age (230), "Male" vs "M", "delhi" vs "Delhi", duplicate row 4, negative income.
Problem foundCleaning action
Missing age (row 2)Fill with the median of valid ages (28)
Impossible age 230 (row 3)Treat as error, replace with median (28) or correct from source
"Male" vs "M", "delhi" vs "Delhi"Use one standard format
Duplicate row 4Remove it
Negative income (row 5)Treat as error, replace with median income (46000)
IDNameAgeGenderIncomeCity
1Amit25M40000Delhi
2Neha28F52000Delhi
3Raj28M38000Delhi
5Sita31F46000Mumbai
6Pooja28F60000Mumbai
After cleaning: duplicate removed, missing or impossible values filled with the median (age 28, income 46000), labels made consistent.
Role of normalization
Distance-based methods (k-NN, k-means) treat big numbers as more important
Min–max: v′ = (v − min)/(max − min) puts income and age both in 0 to 1
IncomeMin–maxZ-score
400000.09-0.89
520000.640.60
380000.00-1.14
460000.36-0.15
600001.001.59
Min = 38000, max = 60000, mean = 47200, population standard deviation = 8060.
PairDistance on raw valuesDistance after min–max
Amit (25, ₹40000) and Ben (26, ₹41000)10000.027
Amit and Chris (60, ₹40500)5010.875
Raw values say Chris is closer to Amit (501 < 1000), only because income has big numbers. After scaling, Ben (age 26) is correctly closer than Chris (age 60).
Effect: cleaning improves accuracy, completeness and consistency. Normalization makes attributes comparable. Together they give more reliable clusters, classifications and predictions. Clean first, then normalize.