Data Mining:
Concepts and Techniques
— Chapter 2 —
1
Chapter 2: Getting to Know Your Data
◼ Types of Data Sets .
◼ Important Characteristics of Structured Data.
◼ Data Objects and Attribute Types
◼ Summary
2
Types of Data Sets
◼ Record
◼ Relational records
◼ Data matrix, e.g., numerical matrix,
timeout
season
coach
game
score
team
ball
lost
pla
crosstabs
wi
n
y
◼ Document data: text documents: term-
frequency vector
Document 1 3 0 5 0 2 6 0 2 0 2
◼ Transaction data
◼ Graph and network Document 2 0 7 0 2 1 0 0 3 0 0
◼ World Wide Web Document 3 0 1 0 0 1 2 2 0 3 0
◼ Social or information networks
◼ Molecular Structures
◼ Ordered TID Items
◼ Video data: sequence of images 1 Bread, Coke, Milk
◼ Temporal data: time-series
2 Beer, Bread
◼ Sequential Data: transaction sequences
3 Beer, Coke, Diaper, Milk
◼ Genetic sequence data
◼ Spatial, image and multimedia: 4 Beer, Bread, Diaper, Milk
◼ Spatial data: maps 5 Coke, Diaper, Milk
◼ Image data:
◼ Video data:
3
4
Crosstab
5
Crosstab
◼ A crosstab is a table that lets you compare two or more types of data
to see how often they overlap. It’s commonly used in surveys to see
how often two different answers appear in the same respondent
profiles.
6
Graph-based Data
7
8
Important Characteristics of Structured
Data
◼ Dimensionality.
◼ Sparsity.
◼ Resolution.
◼ Distribution
9
Characteristics of Structured Data
◼ Dimensionality
◼ Curse of dimensionality: Refers to the number
of variables or features used to describe the data.
The more dimensions, the more complex the data.
◼ Sparsity
◼ Only presence counts :In some cases, the
presence of a feature is more important than its
actual value. For example, in text analysis, the
presence of a specific word might be more
significant than its frequency.
10
Characteristics of Structured Data
◼ Resolution
◼ Patterns depend on the scale: The patterns
that can be discovered in the data may differ based on
the scale used. For example, daily data patterns might
differ from monthly data patterns.
◼ Distribution
◼ Centrality and dispersion: Refers to how values
are spread out in a dataset.
11
Data Objects
◼ Data sets are made up of data objects.
◼ A data object represents an entity.
◼ Examples:
◼ sales database: customers, store items, sales
◼ medical database: patients, treatments
◼ university database: students, professors, courses
◼ Also called samples , examples, instances, data points,
objects, tuples.
◼ Data objects are described by attributes.
◼ Database rows -> data objects; columns ->attributes.
12
Attributes
◼ Attribute (or dimensions, features, variables):
a data field, representing a characteristic or feature
of a data object.
◼ E.g., customer _ID, name, address
13
Attribute Types
◼ Types of attribute:
◼ Nominal
◼ Ordinal
◼ Binary
◼ Numeric: quantitative
◼ Interval-scaled
◼ Ratio-scaled
14
Attribute Types
◼ Nominal: categories, states, or “names of things”
◼ Hair_color = {auburn, black, blond, brown, grey, red, white}
◼ marital status, occupation, ID numbers, zip codes
◼ Ordinal
◼ Values have a meaningful order (ranking) but magnitude between
successive values is not known.
◼ Size = {small, medium, large}, grades, army rankings
15
Attribute Types
◼ Binary
◼ Nominal attribute with only 2 states (0 and 1)
◼ Symmetric binary: both outcomes equally important
◼ e.g., gender
◼ Asymmetric binary: outcomes not equally important.
◼ e.g., medical test (positive vs. negative)
◼ Convention: assign 1 to most important outcome (e.g., HIV
positive)
16
Numeric Attribute Types
◼ Quantity (integer or real-valued)
◼ Interval
◼ Measured on a scale of equal-sized units
◼ Values have order
◼ E.g., temperature in C˚or F˚, calendar dates
◼ No true zero-point
◼ Ratio
◼ Inherent zero-point
◼ We can speak of values as being an order of
magnitude larger than the unit of measurement
(10 K˚ is twice as high as 5 K˚).
◼ e.g., temperature in Kelvin, length, counts,
monetary quantities
17
Attribute Types
18
Attribute Types
19
Discrete vs. Continuous Attributes
◼ Discrete Attribute
◼ Has only a finite or countably infinite set of values
◼ E.g., zip codes, profession, or the set of words in a
collection of documents
◼ Sometimes, represented as integer variables
◼ Note: Binary attributes are a special case of discrete
attributes
20
Discrete vs. Continuous Attributes
◼ Continuous Attribute
◼ Has real numbers as attribute values
◼ E.g., temperature, height, or weight
◼ Practically, real values can only be measured and
represented using a finite number of digits
◼ Continuous attributes are typically represented as
floating-point variables
21
Summary
◼ Many types of data sets, e.g., numerical, text, graph, Web, and image.
◼ Important Characteristics of Structured Data: Dimensionality, Sparsity,
Resolution, and Distribution.
◼ Data attribute types: nominal, binary, ordinal, interval-scaled, and ratio-
scaled.
22