UNIT 1: Introduction to Data Mining
What is Data Mining?
Data mining is the process of discovering patterns, correlations, anomalies,
and useful information from large sets of data using statistical,
mathematical, and computational techniques. It helps in making decisions,
predictions, and understanding data trends.
Example: An e-commerce company analyzing purchase history to
recommend relevant products.
Kinds of Data
1. Structured Data: Clearly defined data types in a fixed field (e.g.,
relational databases like SQL).
o Example: Student records with fields like Roll No., Name, Marks.
2. Unstructured Data: Data without predefined structure (e.g., emails,
images, social media posts).
o Example: Customer reviews on a product.
3. Semi-structured Data: Combination of structured and unstructured
(e.g., XML, JSON).
o Example: Product data with specifications in a nested format.
Knowledge Discovery Process (KDD)
A multi-step process to extract useful knowledge from data: 1. Data
Cleaning – Remove noise and inconsistent data 2. Data Integration –
Combine data from multiple sources 3. Data Selection – Select relevant
data for analysis 4. Data Transformation – Transform into appropriate
formats 5. Data Mining – Apply algorithms to extract patterns 6. Pattern
Evaluation – Identify interesting patterns 7. Knowledge Presentation –
Use visualization to present results
Data Mining Functionalities (with Examples)
1. Classification: Assign items to predefined categories.
o Example: Classifying emails as “Spam” or “Not Spam”.
2. Clustering: Group similar items without predefined labels.
o Example: Customer segmentation based on shopping behavior.
3. Association Rule Mining: Find relationships between variables.
o Example: Market basket analysis – “Customers who buy bread
often buy butter.”
4. Regression: Predict continuous numeric values.
o Example: Predicting house prices based on size, location.
5. Anomaly Detection (Outlier Analysis): Identify rare or unusual data
items.
o Example: Detecting fraudulent credit card transactions.
6. Summarization: Provide a compact description of data.
o Example: Monthly sales summary report.
Kinds of Patterns in Data Mining
Kinds of Patterns in Data Mining
Patterns are meaningful relationships or trends in data. These are the core of data mining results.
1. Class/Concept Description Patterns
Definition: Summarizes the data characteristics of a class (target group).
Example: In a student database, describing characteristics of "top performers" like:
o CGPA > 8.5
o Attendance > 90%
o Participation in projects = YES
2. Frequent Patterns
Definition: Patterns that occur often in a dataset. These are crucial in market basket
analysis.
Example: In supermarket transactions:
o If people buy bread and butter, they also buy jam.
o Pattern: {Bread, Butter} → Jam
3. Association Rules
Definition: Shows how items are associated with each other in large datasets.
Example:
o Rule: Milk → Cookies [support=20%, confidence=70%]
o Meaning: 20% of all transactions contain both milk and cookies, and 70% of the
transactions that contain milk also contain cookies.
4. Sequential Patterns
Definition: Patterns where one event follows another over time.
Example: In an e-commerce site:
o Customer visits home page → searches for laptops → adds to cart → purchases
o Pattern: Homepage → Laptop search → Add to Cart → Purchase
5. Classification Patterns
Definition: Mapping data into predefined classes.
Example: Email classifier:
o If "Subject contains 'Win'" and "Sender unknown" → Classify as SPAM
6. Clustering Patterns
Definition: Grouping data into clusters with similar features (no predefined labels).
Example:
o Grouping customers based on age, location, and spending habits.
o Clusters:
Group A: Teenagers with low spending
Group B: Professionals with high spending
7. Outlier Patterns (Anomalies)
Definition: Data points that deviate significantly from the norm.
Example:
o A monthly electricity bill of ₹10,000 when the usual is ₹2,000.
o This is an outlier, possibly due to a faulty meter or fraud.
Summary Table:
Kind of
Key Use Case Example
Pattern
Summarize features of a Top students = CGPA >
Class/Concept
group 8.5
Kind of
Key Use Case Example
Pattern
Frequent
Find common itemsets Bread + Butter → Jam
Patterns
Association Discover item
Milk → Cookies
Rules relationships
Sequential Identify time-based Search → View →
Patterns behaviors Purchase
Classification Assign labels to data Spam Email Detection
Clustering Group similar data Customer Segmentation
Outlier Unusual ₹10,000
Spot unusual data
Detection electricity bill
1. Frequent Patterns: Patterns that appear often in datasets.
o Example: People who buy milk also buy bread.
2. Sequential Patterns: Patterns where one event leads to another.
o Example: If a person watches episode 1, they likely watch
episode 2 next.
3. Associative Patterns: Relationships among variables.
o Example: 80% of people who buy laptops also buy a mouse.
4. Clustering Patterns: Group data into meaningful clusters.
o Example: Grouping customers by buying habits.
5. Classification Patterns: Build models to assign class labels.
o Example: Loan applicants classified as high or low risk.
6. Outlier Patterns: Identify rare or unexpected patterns.
o Example: A sudden spike in login attempts may signal a cyber-
attack.
Major Issues in Data Mining
1. Data Quality: Incomplete or noisy data affects accuracy.
2. Scalability: Handling large-scale data efficiently.
3. Privacy and Security: Protecting sensitive information.
4. Interpretability: Understanding and explaining the output.
5. Diversity of Data Types: Handling multimedia, text, time-series
data.
Data Objects and Attribute Types
Data Objects: Examples include customers, products, transactions.
Attribute Types:
o Nominal (Names, labels – e.g., Gender)
o Ordinal (Order matters – e.g., Rankings)
o Interval (Numeric scale without true zero – e.g., Temperature)
o Ratio (Numeric with true zero – e.g., Age, Height)
Basic Statistical Descriptions of Data
Mean, Median, Mode, Variance, Standard Deviation – Describe
data distribution.
Frequency Distributions, Histograms – Visual representation of
data.
Data Visualization
Helps in understanding complex data using charts, plots, and dashboards.
Example: Pie charts for market share; heatmaps for correlation.
Measuring Data Similarity and Dissimilarity
Euclidean Distance: For numeric data (straight-line distance)
Jaccard Coefficient: For binary attributes
Cosine Similarity: For text data
Example: Grouping similar news articles using cosine similarity.
Data Pre-processing
Major Tasks: 1. Data Cleaning: Handle missing or noisy data 2. Data
Integration: Merge data from multiple sources 3. Data Transformation:
Normalize or aggregate data 4. Data Reduction: Reduce volume but
produce similar analysis results 5. Data Discretization: Convert continuous
data into categorical
Example: - Removing null values (cleaning) - Combining sales data from
different branches (integration) - Converting age into age groups like 18–25,
26–35 (discretization)
Noisy data refers to data that contains errors, irrelevant information,
or random variations that don’t represent the true characteristics of what
is being measured. It can reduce the accuracy of data mining models and
make it harder to detect real patterns.
Noisy data is dirty or messy data — like spelling mistakes, incorrect values, or sensor errors —
that can confuse the system during analysis.
Examples of Noisy Data:
1. Typographical errors: "Ram" written as "Ramm" in a student database.
2. Sensor errors: A temperature sensor showing 800°C due to a fault.
3. Missing values: Fields left blank in a survey.
✅ End of Unit 1 Notes