Data
Engr. Sifaeli Sabaya
Mr. Christopher James,
Mining Faculty of Informatics
Computer Science and
Introduction Mathematics Department
Introduction to Data Mining
●Data mining is the process of discovering patterns,
correlations, and anomalies in large datasets to make
data -driven decisions.
●Helps organizations turn raw data into useful
information.
●Customer purchase patterns, fraud detection, market
analysis.
Prepared by Christopher James 2
What is Data Mining?
●Discovering meaningful patterns and trends using
some mathematical algorithm on huge amount of
stored data
●Extraction of interesting, non -trivial, implicit,
previously unknown and potentially useful
information or patterns from data
●Analysis of data and the use of software techniques
for finding patterns and regularities in sets of data
Prepared by Christopher James 3
What is Data Mining?
●Data mining is the exploration and analysis of large quantities of
data in order to discover valid, novel, potentially useful, and
ultimately understandable patterns in data.
●Valid: The patterns hold in general.
●Novel: We did not know the pattern beforehand.
●Useful: We can devise actions from the patterns.
●Understandable: We can interpret and comprehend the
patterns.
Prepared by Christopher James 4
What is Data Mining?
●Process of discovering patterns, correlations , and anomalies in
large datasets to make decisions and predictions .
●Examples of tasks addressed by Data Mining
○Predictive Modeling (classification, regression)
○Segmentation (Data Clustering )
○Summarization
○Visualization
Prepared by Christopher James 5
The Need for Data Mining
●The amount of raw data stored in corporate data warehouses is
growing rapidly .
●There is too much data and complexity that might be relevant to a
specific problem.
●Data mining promises to bridge the analytical gap by giving
knowledge workers the tools to navigate this complex analytical
space .
●The need for information has resulted in the proliferation of data
warehouses that integrate information multiple sources to support
decision making.
●Often include data from external sources , such as customer
demographics and household information.
Prepared by Christopher James 6
● Changes in the Business Environment
● Customers becoming more demanding
● Markets are saturated
● Databases today are huge:
● More than 1,000,000
entities/records/rows
● From 10 to 10,000
fields/attributes/variables
Data Mining
●
●
Gigabytes and terabytes
Databases a growing at an
Motivation
unprecedented rate
● Decisions must be made rapidly
● Decisions must be made with maximum
knowledge
Prepared by Christopher James Prepared by Christopher James 7
Data Mining Vs. Database Query
Data Mining Da ta b a se
●inte re sting p a tte rns a nd fa c ts ● Norm a l q ue rie s from the
suc h a s wha t a re the im p orta nt d a ta b a se suc h a s wha t is a n
tre nd s in se lls a ve ra g e turnove r
● m ore fa ste r tha n q ue ry in tre nd ● If we know e xa c tly wha t we a re
a nd p a tte rn a na lysis looking for, we use q ue ry
● use s a lg orithm like m a c hine
le a rning , g e ne tic a lg orithm
● If we know only va g ue ly wha t we
a re looking for we use d a ta
m ining .
Prepared by Christopher James 8
● Da ta Cle a ning : Re m ove or c orre c t noisy
d a ta .
● Da ta Inte g ra tion: Com b ine d a ta from
m ultip le sourc e s. Steps in KDD
● Da ta Se le c tion: Extra c t re le va nt d a ta for
a na lysis. Knowledge Discovery in
● Da ta Tra nsform a tion: Conve rt d a ta into Databases
a suita b le form a t.
● Da ta Mining : Ap p ly a lg orithm s to find
p a tte rns.
● Pa tte rn Eva lua tion: Id e ntify inte re sting
p a tte rns.
● Knowle d g e Re p re se nta tion: Visua lize
a nd p re se nt find ing s.
Prepared by Christopher James Prepared by Christopher James 9
System
Architecture ● Data Sources: Databases,
data warehouses, web.
● Data Mining Engine: Core
modules for pattern
discovery.
● Pattern Evaluation Module:
Ensures relevant patterns.
● User Interface: Allows users
to interact with the system.
Prepared by Christopher James 10
● Qua lita tive : Nom ina l
(c a te g orie s), Bina ry (two
sta te s), Ord ina l (ord e re d
va lue s).
Types of Data in
Data Mining
● Qua ntita tive : Disc re te
(c ounta b le ), Continuous
(m e a sura b le ).
Prepared by Christopher James Prepared by Christopher James 11
Qualitative Attributes
●Nominal/categorical Attributes: Values represent categories or
states with no inherent order. Example: Colors, names
●Binary Attributes: Only two possible values or states
○Symmetric: Both values are equally important (e.g., Gender)
○Asymmetric: Values are not equally important (e.g., Pass/Fail)
●Ordinal Attributes: Values have a meaningful sequence or
ranking. Magnitude between values is not known. Example:
Survey ratings (e.g., Poor, Fair, Good)
Prepared by Christopher James 12
Quantitative Attributes
●Numeric Attributes
○Measurable quantities represented in integer or real values
○Interval -scaled: Differences are interpretable, but no true zero point
(e.g., Temperature in Celsius)
○Ratio-scaled: Has a true zero point, allowing for meaningful ratios
(e.g., Weight, Height)
●Discrete Attributes: Finite or countably infinite set of values. Example:
Number of students in a class
●Continuous Attributes: Infinite number of states, often represented as
float values. Example: Height, weight
Prepared by Christopher James 13
● Descriptive Tasks: Characterize
general properties of data.
Example: Summary of
Data Mining customer demographics.
Predictive Tasks: Make
Functionalities
●
predictions based on existing
data. Example: Predicting sales
for the next quarter.
Prepared by Christopher James 14
Descriptive Data Mining
●Characterizes the general properties of data in the database
●Finds important patterns or information in data
●Mostly used during data exploration
●It answered following questions:
●What is in the data? What does( n’t) it look like? Are there any
unusual patterns? What does the data suggest for customer
segmentation?
●Functionalities: Clustering, Summarization, Visualization, and
Association
Prepared by Christopher James 15
Predictive Data Mining
●Where
X: Vectors of independent variables
Y:Dependent Variable
●It answered following type of questions: Who is likely to
respond to next product?
●Which customers are likely to leave in the next six months?
●Used to predict outcomes whose inputs are known but the
output values are not realized yet.
Prepared by Christopher James 16
● By Da ta b a se Typ e : Re la tiona l,
tra nsa c tiona l, d a ta wa re house .
Classification of ● By Te c hniq ue s Use d : Ma c hine
le a rning , sta tistic al a na lysis.
Data Mining Systems
● By Ap p lic a tions: Fina nc e ,
he a lthc a re , m a rke ting .
Prepared by Christopher James 17
Data Preprocessing
●Data cleaning: Fill in missing values, smooth noisy data,
identify or remove outliers, and resolve inconsistencies
●Data integration: Integration of multiple databases, data
cubes, or files
●Data transformation: Normalization and aggregation
●Data reduction: Obtains reduced representation in
volume but produces the same or similar analytical
results
Prepared by Christopher James 18
Why Data Preprocessing?
●Data in the real world is dirty
○Incomplete : lacking attribute values, lacking certain attributes
of interest, or containing only aggregate data
○Noisy : containing errors or outliers
○Inconsistent : containing discrepancies in codes or names
●No quality data, no quality mining results!
○Quality decisions must be based on quality data
○Data warehouse needs consistent integration of quality data
Prepared by Christopher James 19
Data Preprocessing: Terminologies
●Population - the collection of all individuals or items under consideration in a
statistical study
●Sample - that part of the population from which information is collected
●Parameter – statistical description of the population
●Variable – characteristic that varies from one item to another e.g.
Quantitative (numerical) Qualitative (categorical)
●Data: Observing the values of the variables yield data
●Observation – individual piece of data
●Data matrix – collection of observations for variable Data matrix k variables
measured in sample with the size of n
Prepared by Christopher James 20
Data Quality problems
●What kinds of data quality problems?
●How can we detect problems with the data?
●What can we do about these problems?
●Examples of data quality problems:
Noise a nd outlie rs
m issing va lue s
d up lic a te d a ta
Prepared by Christopher James 21
Noise
• Noise refers to modification of original values
– Examples: distortion of a person’s voice when talking on a poor phone and
“snow” on television screen
Two Sine Waves Two Sine Waves + Noise
Prepared by Christopher James
Outliers
●Outliers are data objects with characteristics that are
considerably different than most of the data set
Prepared by Christopher James 23
How to Handle Noisy Data?
●Binning method:
●first sort data and partition into ( equi -depth) bins
●then one can smooth by bin means, smooth by bin median
●Equal-width (distance) partitioning:
●It divides the range into N intervals of equal size: uniform grid
●if A and B are the lowest and highest values of the attribute, the
●width of intervals will be: W = (B -A)/N.
●Equal-depth (frequency) partitioning:
●It divides the range into N intervals, each containing approximately same number of samples
●Managing categorical attributes can be tricky.
●Combined computer and human inspection
●– detect suspicious values and check by human
Prepared by Christopher James 24
Missing Values
●Reasons for missing values
○Information is not collected (e.g., people decline to give their age and
weight)
○Attributes may not be applicable to all cases (e.g., annual income is not
applicable to children)
●Handling missing values
○Eliminate Data Objects
○Estimate Missing Values
○Ignore the Missing Value During Analysis
○Replace with all possible values (weighted by their probabilities)
Prepared by Christopher James 25
How to Handle Missing Data?
●Ignore the tuple: usually done when class label is missing (assuming the
tasks in classification —not effective when the percentage of missing values
per attribute varies considerably.
●Fill in the missing value manually: tedious + infeasible?
●Use a global constant to fill in the missing value: e.g., “unknown”, a new
class?!
●Use the attribute mean to fill in the missing value
●Use the attribute mean for all samples belonging to the same class to fill in
●the missing value: smarter
●Use the most probable value to fill in the missing value: inference -based
such as Bayesian formula or decision tree
Prepared by Christopher James 26
Duplicate Data
●Data set may include data objects that are duplicates, or
almost duplicates of one another. Major issue when merging
data from heterogeous sources
●Examples:
●Same person with multiple email addresses
●Data cleaning
●Process of dealing with duplicate data issues
Prepared by Christopher James 27
Data Mining Application Areas
●Finance: Fraud detection, risk management.
●Retail: Customer behavior analysis.
●Telecommunications: Fraud detection, resource
optimization.
●Biological Data: Genomics, protein pathways.
●Visual Examples: Show applications with industry
icons.
Prepared by Christopher James 28
Activities & Practice
●Activity 1: List possible applications of data mining in
your area of interest.
●Activity 2: Identify examples of qualitative and
quantitative data in your surroundings.
Prepared by Christopher James 29