7class - Laurentian
Download
Report
Transcript 7class - Laurentian
Data Mining:
Concepts and Techniques
(3rd ed.)
— Chapter 9 —
Classification: Advanced Methods
Jiawei Han, Micheline Kamber, and Jian Pei
University of Illinois at Urbana-Champaign &
Simon Fraser University
©2009 Han, Kamber & Pei. All rights reserved.
7/21/2015
Data Mining: Concepts and Techniques
1
Chapter 9. Classification: Advanced Methods
Bayesian Belief Networks
Classification by Neural Networks
Support Vector Machines
Pattern-Based Classification
Lazy Learners (or Learning from Your Neighbors)
Other Classification Methods
Summary
July 21, 2015
Data Mining: Concepts and Techniques
3
Bayesian Belief Networks
Bayesian belief networks allow class conditional
independencies between subsets of variables
A graphical model of causal relationships
Represents dependency among the variables
Gives a specification of joint probability distribution
Nodes: random variables
Links: dependency
Y
X
X and Y are the parents of Z, and Y is
the parent of P
Z
July 21, 2015
P
No dependency between Z and P
Has no loops or cycles
Data Mining: Concepts and Techniques
4
Bayesian Belief Network: An Example
Family
History (FH)
Smoker (S)
The conditional probability table
(CPT) for variable LungCancer:
(FH, S) (FH, ~S) (~FH, S) (~FH, ~S)
LungCancer
(LC)
Emphysema
LC
0.8
0.5
0.7
0.1
~LC
0.2
0.5
0.3
0.9
CPT for LungCancer (LC) shows the
conditional probability for each possible
combination of its parents
PositiveXRay
Dyspnea
Bayesian Belief Network
Derivation of the probability of a
particular combination of values of X,
from CPT:
n
P ( x1 ,..., xn ) P ( x i | Parents(Y i ))
i 1
5
Training Bayesian Networks
Several scenarios:
Given both the network structure and all variables
observable: learn only the CPTs
Network structure known, some hidden variables:
gradient descent (greedy hill-climbing) method,
analogous to neural network learning
Network structure unknown, all variables observable:
search through the model space to reconstruct
network topology
Unknown structure, all hidden variables: No good
algorithms known for this purpose
Ref. D. Heckerman: Bayesian networks for data mining
6
Gradient Descent
Let D be training set of data tuples X1, X2, …, X|D|
Training the belief network – learn the values of CPT
Let wijk be a CPT entry for the variable Yi = yij having
parents Ui = uik, where wijk P(Yi = yij|Ui = uik)
Example: let wijk = 0.8 in CPT table (slide 5), then Yi is
LungCancer; yij is its value “yes”; Ui are parent nodes of Yi
{FamilyHistory, Smoker}; uik lists values of parent nodes
{“yes”, “yes”}
Wijk – set of weights W, initialized to random probability
values
Gradient descent – greedy hill-climbing, i.e. at each
iteration, the weights are updated and will eventually
converge to a local optimum solution
7
Gradient Descent
For our problem, we maximize Pw(D) =
|𝐷|
𝑑=1 𝑃𝑤 (𝑋𝑑 )
To make problem simpler, follow the gradient of ln Pw(S)
Given the network topology and initialized wijk,
Step 1: Compute the gradient: For each i, j, k, compute
The probability in the right hand side (say p) is to be
calculated for each training tuple Xd in D
When the variables represented by Yi and Ui are hidden for
some Xd, then the corresponding probability p can be
computed from the observed variables of the tuple using
standard algorithms for Bayesian network inference (e.g.
commercial software package HUGIN)
8
Gradient Descent
Algorithm cont’d
Step 2: Take a small step in the direction of the
gradient: The weights are updated by
Where l is the learning rate representing the step size
and
𝜕 ln 𝑃𝑤 (𝐷)
𝜕𝑤𝑖𝑗𝑘
is computed from Step 1. The learning
rate is set to a small constant and helps with
convergence
Step 3: Renormalize the weights: weights wijk are
probability values and should be between 0.0 and 1.0
and 𝑗 𝑤𝑖𝑗𝑘 = 1 for all i, k
9
Chapter 9. Classification: Advanced Methods
Bayesian Belief Networks
Classification by Neural Networks
Support Vector Machines
Pattern-Based Classification
Lazy Learners (or Learning from Your Neighbors)
Other Classification Methods
Summary
July 21, 2015
Data Mining: Concepts and Techniques
10
Classification: A Mathematical Mapping
Classification:
predicts categorical class labels
E.g., Personal homepage classification
xi = (x1, x2, x3, …), yi = +1 or –1
x1 : # of word “homepage”
x2 : # of word “welcome”
Mathematically
n
x X = , y Y = {+1, –1}
We want a function f: X Y
11
Linear Classification
x
x
x
x
x
x
x
x
x
ooo
o
o
o o
x
o
o
o o
o
o
Binary Classification
problem
The data above the red
line belongs to class ‘x’
The data below red line
belongs to class ‘o’
Examples: SVM,
Perceptron, Probabilistic
Classifiers
12
Discriminative Classifiers
Advantages
prediction accuracy is generally high
robust, works when training examples contain errors
fast evaluation of the learned target function
As compared to Bayesian methods – in general
Bayesian networks are normally slow
Criticism
long training time
difficult to understand the learned function (weights)
Bayesian networks can be used easily for pattern discovery
not easy to incorporate domain knowledge
Easy in the form of priors on the data or distributions
13
Classification by Backpropagation
Backpropagation: A neural network learning algorithm
Started by psychologists and neurobiologists to develop
and test computational analogues of neurons
A neural network: A set of connected input/output units
where each connection has a weight associated with it
During the learning phase, the network learns by
adjusting the weights so as to be able to predict the
correct class label of the input tuples
Also referred to as connectionist learning due to the
connections between units
14
Neural Network as a Classifier
Weakness
Long training time
Require a number of parameters typically best determined
empirically, e.g., the network topology or “structure.”
Poor interpretability: Difficult to interpret the symbolic meaning
behind the learned weights and of “hidden units” in the network
Strength
High tolerance to noisy data
Ability to classify untrained patterns
Well-suited for continuous-valued inputs and outputs
Successful on a wide array of real-world data
Algorithms are inherently parallel
Techniques have recently been developed for the extraction of
rules from trained neural networks
15
A Neuron
bias
- mk
x0
w0
x1
w1
xn
f
output y
wn
For Example
Input
weight
vector x vector w
weighted
sum
Activation
function
n
y sign( wi xi m k )
i 0
The n-dimensional input vector x is mapped into variable y by
means of the scalar product and a nonlinear function mapping
16
A Multi-Layer Feed-Forward Neural Network
Output vector
w(jk 1) w(jk ) ( yi yˆi(k ) ) xij
Output layer
Hidden layer
wij
Input layer
Input vector: X
17
How A Multi-Layer Neural Network Works
The inputs to the network correspond to the attributes measured
for each training tuple
Inputs are fed simultaneously into the units making up the input
layer
They are then weighted and fed simultaneously to a hidden layer
The number of hidden layers is arbitrary, although usually only one
The weighted outputs of the last hidden layer are input to units
making up the output layer, which emits the network's prediction
The network is feed-forward in that none of the weights cycle
back to an input unit or to an output unit of a previous layer
From a statistical point of view, networks perform nonlinear
regression: Given enough hidden units and enough training
samples, they can closely approximate any function
18
Defining a Network Topology
First decide the network topology: # of units in the input
layer, # of hidden layers (if > 1), # of units in each hidden
layer, and # of units in the output layer
Normalizing the input values for each attribute measured in
the training tuples to [0.0—1.0]
One input unit per domain value, each initialized to 0
E.g. if attribute A has three values {a0, a1, a2}, assign
three input units {I0, I1, I2} to represent A
Output, if for classification and more than two classes, one
output unit per class is used
Once a network has been trained and its accuracy is
unacceptable, repeat the training process with a different
network topology or a different set of initial weights
19
Backpropagation
Iteratively process a set of training tuples & compare the network's
prediction with the actual known target value
For each training tuple, the weights are modified to minimize the
mean squared error between the network's prediction and the
actual target value
Modifications are made in the “backwards” direction: from the output
layer, through each hidden layer down to the first hidden layer, hence
“backpropagation”
Steps
Initialize weights (to small random #s) and biases in the network
Propagate the inputs forward (by applying activation function)
Backpropagate the error (by updating weights and biases)
Terminating condition (when error is very small, etc.)
20
21
Backpropagation
Initialize the weights
Initialize the weights to small random numbers, e.g. [1.0, 1.0] or [-0.5, 0.5]
Each unit has a bias associated with it, which are also
initialized to small random numbers
Each training tuple X is processed by the following steps
Propagate the inputs forward
The training tuple is fed to the input layer of the network
The inputs pass through the input units, unchanged
For an input unit j, its output Oj = input value Ij
The net input and output of each unit in the hidden and
output layers are computed
22
Backpropagation
Propagate the inputs forward (cont’d)
The net input to a unit in the hidden or output layers is
computed as a linear combination of its inputs
Given a unit j in a hidden or output layer, the net input Ij
to unit j is 𝐼𝑗 = 𝑖 𝑤𝑖𝑗 𝑂𝑖 + 𝜃𝑗 where
wij is the weight of the connection from unit i in the previous layer
to unit j; Oi is the output of unit i from the previous layer; and j is
the bias of the unit.
The bias acts as a threshold in that it serves to vary the activity of
the unit
Apply activation function to the net input. The logistic or
sigmoid function is used
Given the net input Ij to unit j, then Oj, the output is
𝑂𝑗 =
1
1+ 𝑒
−𝐼𝑗
23
Backpropagation
Propagate the inputs forward (cont’d)
The logistic function is nonlinear and differentiable,
allowing the backpropagation algorithm to model
classification problems that are linearly inseparable
Compute the output values Oj for each hidden layer, up
to and including the output layer, which gives the
network’s prediction
In practice, it is a good idea to cache (i.e. save) the
intermediate output values at each unit as a they are
required again later, when backpropagating the error
24
Backpropagation
Backpropagate the error:
For a unit j in the output layer, the error Errj is
computed by
Errj = Oj(1 – Oj)(Tj – Oj)
Where Oj is the actual output of unit j and Tj is the known target value of
the given training tuple
Oj(1 – Oj) is the derivative of the logistic function
To compute the error of a hidden layer unit j, the
weighted sum of the errors of the units connected to
unit j in the next layer are considered. The error of a
hidden layer unit j is
Errj = Oj(1 – Oj)
𝑘 𝐸𝑟𝑟𝑘 𝑤𝑗𝑘
Where wjk is the weight of the connection from unit j to a unit k in the
next higher layer, and Errk is the error of unit k
25
Backpropagation
Backpropagate the error (cont’d)
The weights and biases are updated to reflect the
propagated errors
Weights are updated by the following equations, where
wij is the change in weight wij
wij = (l) ErrjOi (l is the learning rate, a constant between 0
and 1)
wij = wij + wij
Backpropagation learns using a method of gradient
descent to search for a set of weights that fits the
training data so as to minimize the mean squared
distance between the network’s class prediction and
the known target value of the tuples
26
Backpropagation
Backpropagate the error (cont’d)
The learning rate helps avoid getting stuck at a local
minimum in decision space
Learning rate should not be too small or too big
A rule of thumb: learning rate = 1/t, where t is number
of iterations through the training set so far
Biases are updated as follows, where j is the change
in bias j:
j = (l) Errj
j = j + j
case updating - here we are updating the weights and
biases after the presentation of each tuple
27
Backpropagation
Backpropagate the error (cont’d)
epoch updating - alternatively, the weight and bias
increments could be accumulated in variables, so that
the weights and biases are updated after all the tuples
in the training set have been presented
Terminating condition: training stops when
All wij in the previous epoch were so small as to be
below some specified threshold, or
The percentage of tuples misclassified in the previous
epoch is below some threshold, or
A prespecified number of epochs has expired
In practice, several hundreds of thousands of epochs
may be required before the weights will converge
28
Backpropagation and Interpretability
Efficiency of backpropagation: Each epoch (one iteration through the
training set) takes O(|D| * w), with |D| tuples and w weights, but # of
epochs can be exponential to n, the number of inputs, in worst case
A technique simulated annealing can be used to speed up the
training time, which also ensures convergence to a global optimum
Classifying an unknown tuple using a trained network
The tuple is input to the trained network
The net input and output of each unit are computed
There is no need for the computation and/or backpropagation of
error
If there is one output node per class, then the output node with the
highest value determines the predicted class label for X
If there is only output node , then output values greater than or
equal to 0.5 may be considered as belonging to the positive class,
while values less than 0.5 may be considered negative
29
Backpropagation and Interpretability
Rule extraction from networks: network pruning
Simplify the network structure by removing weighted links that
have the least effect on the trained network
Then perform link, unit, or activation value clustering
The set of input and activation values are studied to derive rules
describing the relationship between the input and hidden unit
layers
Sensitivity analysis: assess the impact that a given input variable has
on a network output. The knowledge gained from this analysis can be
represented in rules such as “IF X decreases 5% THEN Y increases
8%”
30
Backpropagation - Example
A multilayer feed-forward neural network. Let the learning
rate be 0.9 and first training tuple X = (1,0,1) whose class
label is 1
31
Backpropagation - Example
The net input and output calculations
Calculation of the error at each node
32
Chapter 9. Classification: Advanced Methods
Bayesian Belief Networks
Classification by Neural Networks
Support Vector Machines
Pattern-Based Classification
Lazy Learners (or Learning from Your Neighbors)
Other Classification Methods
Summary
July 21, 2015
Data Mining: Concepts and Techniques
33
SVM—Support Vector Machines
A new classification method for both linear and nonlinear
data
It uses a nonlinear mapping to transform the original
training data into a higher dimension
With the new dimension, it searches for the linear optimal
separating hyperplane (i.e., “decision boundary”)
With an appropriate nonlinear mapping to a sufficiently
high dimension, data from two classes can always be
separated by a hyperplane
SVM finds this hyperplane using support vectors
(“essential” training tuples) and margins (defined by the
support vectors)
34
SVM—History and Applications
Vapnik and colleagues (1992)—groundwork from Vapnik
& Chervonenkis’ statistical learning theory in 1960s
Features: training can be slow but accuracy is high owing
to their ability to model complex nonlinear decision
boundaries (margin maximization)
Used for: classification and numeric prediction
Applications:
handwritten digit recognition, object recognition,
speaker identification, benchmarking time-series
prediction tests
35
SVM—General Philosophy
Small Margin
Large Margin
Support Vectors
36
SVM—Margins and Support Vectors
37
SVM—When Data Is Linearly Separable
m
Let data D be (X1, y1), …, (X|D|, y|D|), where Xi is the set of training tuples
associated with the class labels yi
There are infinite lines (hyperplanes) separating the two classes but we want to
find the best one (the one that minimizes classification error on unseen data)
SVM searches for the hyperplane with the largest margin, i.e., maximum
marginal hyperplane (MMH)
38
SVM—Linearly Separable
A separating hyperplane can be written as
W●X+b=0
where W={w1, w2, …, wn} is a weight vector and b a scalar (bias)
For 2-D it can be written as (consider b as additional weight w0)
w0 + w1 x1 + w2 x2 = 0
Any point that lies above the separating hyperplane satisfies
w0 + w1 x1 + w2 x2 > 0
Similarly, any point that lies below the separating hyperplane satisfies
w0 + w1 x1 + w2 x2 < 0
The hyperplane defining the sides of the margin:
H1: w0 + w1 x1 + w2 x2 ≥ 1
for yi = +1, and
H2: w0 + w1 x1 + w2 x2 ≤ – 1 for yi = –1
i.e. any tuple that falls on or above H1 belongs to class +1, and
any tuple that falls on or below H2 belongs to class -1
39
SVM—Linearly Separable
Combining the two inequalities we get:
yi(w0 + w1 x1 + w2 x2) ≥ 1, i
Any training tuples that fall on hyperplanes H1 or H2 (i.e.,
the sides defining the margin) satisfy the above equation
and are called support vectors, i.e. they are equally
close to the (separating) MMH
Supporting vectors shown in bold
40
SVM—Linearly Separable
The distance from the separating hyperplane to any point on
H1 is 1/||W|, where ||W|| is the Euclidean norm of W, that is
𝑊. 𝑊 2
By definition, this is equal to the distance from any point on
H2 to separating hyperplane
Therefore, the maximal margin is
2
|𝑊|
The above equation is rewritten so that it becomes a
constrained (convex) quadratic optimization problem:
Quadratic objective function and linear constraints
Quadratic Programming (QP) Lagrangian multipliers
Either a software package (for small data sets) can be used
or specialized algorithms (for larger data sets) can be used
for training SVMs
41
Classify using Linear SVM
Once we’ve found the support vectors and MMH, we have
a trained support vector machine
The MMH is a linear class boundary and so the
corresponding SVM can be used to classify linearly
separable data (linear SVM)
Based on Lagrangian formulation the MMH can be
rewritten as the decision boundary
d(XT) = 𝑙𝑖=1 𝑦𝑖 𝛼𝑖 𝑋𝑖 𝑋 𝑇 + 𝑏0
where yi is the class label of support vector Xi;XT is a
test tuple; i and b0 are numeric parameters that were
determined automatically by the optimization or SVM
algorithm; and l is the number of support vectors
42
Classify using Linear SVM
For linearly separable data, the support vectors are a
subset of the actual training tuples
Given a test tuple XT, we plug it into equation given in last
slide for d(XT), and then check to see the sign of the result
If the sign is +ve, then XT falls on or above the MMH, and
so the SVM predicts that XT belongs to class +1
If the sign is –ve, then XT falls on or below the MMH and
the class prediction is -1
43
Why Is SVM Effective on High Dimensional Data?
The complexity of trained classifier is characterized by the # of
support vectors rather than the dimensionality of the data
The support vectors are the essential or critical training tuples—they
lie closest to the decision boundary (MMH)
If all other training examples are removed and the training is
repeated, the same separating hyperplane would be found
The number of support vectors found can be used to compute an
(upper) bound on the expected error rate of the SVM classifier, which
is independent of the data dimensionality
Thus, an SVM with a small number of support vectors can have good
generalization, even when the dimensionality of the data is high
44
SVM—Linearly Inseparable
Create nonlinear SVMs for the classification of linearly
inseparable data
Step 1: Transform the original input data into a higher
dimensional space using a nonlinear mapping
Step 2: Search for a linear separating hyperplane in the
new space
We again have a quadratic optimization problems that is
solved using linear SVM formulation
The maximal marginal hyperplane found in the new space
corresponds to a nonlinear separating hypersurface in the
original space
45
SVM—Linearly Inseparable
Example: Nonlinear transformation of original input data into
a higher dimensional space
A 3D input vector X = (x1, x2, x3) is mapped into a 6D
space Z using the following mapping:
2
1(X) = x1, 2(X) = x2, 3(X) = x3, 4(X) = (x1) , 5(X) =
x1x2, 6(X) = x1x3
A decision hyperplane in the new space is d(Z) = WZ + b,
where W and Z are vectors. This is linear.
We solve for W and b and then substitute back so that the
linear decision hyperplane in the new (Z) space
corresponds to a nonlinear second-order polynomial in the
original 3D input space
d(Z) = w1x1 + w2x2 + w3x3 + w4(x1)2 + w5x1x2 + w6x1x3 + b
= w1z1 + w2z2 + w3z3 + w4z4 + w5z5 + w6z6 + b
46
SVM—Linearly Inseparable
Problems:
How to choose the nonlinear mapping to a higher
dimensional space?
The computation involved is costly – we have to
compute the dot product for every support vector and
in training, several times to find MMH
MATH trick:
In solving the quadratic optimization problem of the
linear SVM, the training tuples appear only in the form
of dot products (Xi).(Xj), where (X) is simply the
nonlinear mapping function applied to transform the
training tuples
47
SVM—Kernel functions
Instead of computing the dot product on the transformed data tuples,
it is mathematically equivalent to instead applying a kernel function
K(Xi, Xj) to the original data, i.e., K(Xi, Xj) = Φ(Xi) Φ(Xj)
Typical Kernel Functions
SVM can also be used for classifying multiple (> 2) classes and for
regression analysis (with additional user parameters)
48
Scaling SVM by Hierarchical Micro-Clustering
SVM is not scalable to the number of data objects in terms of training
time and memory usage
“Classifying Large Datasets Using SVMs with Hierarchical Clusters
Problem” by Hwanjo Yu, Jiong Yang, Jiawei Han, KDD’03
CB-SVM (Clustering-Based SVM)
Given limited amount of system resources (e.g., memory),
maximize the SVM performance in terms of accuracy and the
training speed
Use micro-clustering to effectively reduce the number of points to
be considered
At deriving support vectors, de-cluster micro-clusters near
“candidate vector” to ensure high classification accuracy
49
CB-SVM: Clustering-Based SVM
Training data sets may not even fit in memory
Read the data set once (minimizing disk access)
Construct a statistical summary of the data (i.e., hierarchical
clusters) given a limited amount of memory
The statistical summary maximizes the benefit of learning SVM
The summary plays a role in indexing SVMs
Essence of Micro-clustering (Hierarchical indexing structure)
Use micro-cluster hierarchical indexing structure
provide finer samples closer to the boundary and coarser
samples farther from the boundary
Selective de-clustering to ensure high accuracy
50
CF-Tree: Hierarchical Micro-cluster
51
CB-SVM Algorithm: Outline
1.
2.
3.
4.
Construct two CF-trees from positive and negative data sets
independently
Need one scan of the data set
Train an SVM boundary function from the centroids of the root
entries – entries in the root node – of the two CF trees
If the root node contains too few entries, train from entries of the
nodes in the second levels of the trees
De-cluster the entries near the boundary into the next level
The children entries de-clustered from the parent entries are
accumulated into the training set with the non-declustered parent
entries
Train an SVM again from the centroids of the entries in the training
set
Repeat from step 3 until nothing is accumulated
52
Selective Declustering
CF tree is a suitable base structure for selective declustering
De-cluster only the cluster Ei such that
Di – Ri < Ds, where Di is the distance from the boundary to
the center point of Ei and Ri is the radius of Ei
Decluster only the cluster whose subclusters have
possibilities to be the support cluster of the boundary
“Support cluster”: The cluster whose centroid is a
support vector
53
Experiment on Synthetic Dataset
54
Experiment on a Large Data Set
55
SVM vs. Neural Network
SVM
Relatively new concept
Deterministic algorithm
Nice generalization
properties
Hard to learn – learned
in batch mode using
quadratic programming
techniques
Using kernels can learn
very complex functions
Neural Network
Relatively old
Nondeterministic
algorithm
Generalizes well but
doesn’t have strong
mathematical foundation
Can easily be learned in
incremental fashion
To learn complex
functions—use multilayer
perceptron (not that
trivial)
56
SVM Related Links
SVM Website
http://www.kernel-machines.org/
Representative implementations
LIBSVM: an efficient implementation of SVM, multi-class
classifications, nu-SVM, one-class SVM, including also various
interfaces with java, python, etc.
SVM-light: simpler but performance is not better than LIBSVM,
support only binary classification and only C language
SVM-torch: another recent implementation also written in C.
57
Notes about SVM—
Introductory Literature
“Statistical Learning Theory” by Vapnik: difficult to understand,
containing many errors.
C. J. C. Burges. A Tutorial on Support Vector Machines for Pattern
Recognition. Knowledge Discovery and Data Mining, 2(2), 1998.
Easier than Vapnik’s book, but still not introductory level; the
examples are not so intuitive
The book An Introduction to Support Vector Machines by Cristianini
and Shawe-Taylor
Not introductory level, but the explanation about Mercer’s
Theorem is better than above literatures
Neural Networks and Learning Machines by Haykin
Contains a nice chapter on SVM introduction
July 21, 2015
Data Mining: Concepts and Techniques
58
Chapter 9. Classification: Advanced Methods
Bayesian Belief Networks
Classification by Neural Networks
Support Vector Machines
Pattern-Based Classification
Lazy Learners (or Learning from Your Neighbors)
Other Classification Methods
Summary
July 21, 2015
Data Mining: Concepts and Techniques
59
Associative Classification
Associative classification
Association rules are generated and analyzed for use in classification
Search for strong associations between frequent patterns
(conjunctions of attribute-value pairs) and class labels
Classification: Based on evaluating a set of rules in the form of
P1 ^ p2 … ^ pl “Aclass = C” (conf, sup)
Why effective?
It explores highly confident associations among multiple attributes
and may overcome some constraints introduced by decision-tree
induction, which considers only one attribute at a time
In many studies, associative classification has been found to be more
accurate than some traditional classification methods, such as C4.5
July 21, 2015
Data Mining: Concepts and Techniques
60
Typical Associative Classification Methods
In general, associative classification consists of the following steps:
Mine the data for frequent itemsets, i.e. find commonly occurring
attribute-value pairs in the data
Analyze the frequent itemsets to generate association rules per class,
which satisfy confidence and support criteria
Organize the rules to form a rule-based classifier
CBA (Classification Based on Associations: Liu, Hsu & Ma, KDD’98)
Mine possible association rules in the form of
Cond-set (a set of attribute-value pairs) class label
CBA uses an iterative approach to frequent itemset mining, where
multiple passes are made over the data and the derived frequent
itemsets are used to generate and test longer itemsets
In general, the number of passes made is equal to the length of the
longest rule found
July 21, 2015
Data Mining: Concepts and Techniques
61
Typical Associative Classification Methods
CBA (cont’d)
A heuristic method is used to build the classifier, where the rules
are ordered according to decreasing precedence based on
confidence and then support
If a set of rules has the same antecedent, then the rule with the
highest confidence is selected to represent the set
When classifying a new tuple, the first rule satisfying the tuple is
used to classify it
The classifier also contains a default rule, having lowest
precedence, which specifies a default class for any new tuple that
is not satisfied by any other rule
The set of rules making up the classifier form a decision list
CBA was empirically found to be more accurate that C4.5 on a
good number of data sets
62
Typical Associative Classification Methods
CMAR (Classification based on Multiple Association Rules: Li, Han, Pei, ICDM’01)
Classification: Statistical analysis on multiple rules
Details in next slides …
CPAR (Classification based on Predictive Association Rules: Yin & Han, SDM’03)
Generation of predictive rules based on a rule generation
algorithm for classification called FOIL
FOIL builds rules to distinguish positive tuples from negative tuples
For multiclass problems, FOIL is applied to each class
For a class C, all tuples of class C are considered positive tuples,
while the rest are considered negative tuples
Rules are generated to distinguish C tuples from all others
Each time a rule is generated, the positive samples it satisfies (or
covers) are removed until all the positive tuples in the data set are
covered
63
Typical Associative Classification Methods
CPAR cont’d
If more than one rule satisfies a new tuple X, the rules are divided
into groups according to class, similar to CMAR
CPAR uses the best k rules of each group to predict the class label
of X, based on expected accuracy
High accuracy similar to CMAR but better efficiency with large sets
of training data
RCBT (Mining top-k covering rule groups for gene expression data, Cong et al.
SIGMOD’05)
Explore high-dimensional classification, using top-k rule groups
Achieve high classification accuracy and high run-time efficiency
64
A Closer Look at CMAR
CMAR (Classification based on Multiple Association Rules: Li, Han, Pei, ICDM’01)
Efficiency: Uses an enhanced FP-tree that maintains the distribution of
class labels among tuples satisfying each frequent itemset
Rule pruning whenever a rule is inserted into the tree
Given two rules, R1 and R2, if the antecedent of R1 is more general
than that of R2 and conf(R1) ≥ conf(R2), then prune R2
Prunes rules for which the rule antecedent and class are not
positively correlated, based on a χ2 test of statistical significance
Classification based on generated/pruned rules
If only one rule satisfies tuple X, assign the class label of the rule
If a rule set S satisfies X, CMAR
divides S into groups according to class labels
2
uses a weighted χ measure to find the strongest group of rules,
based on the statistical correlation of rules within a group
assigns X the class label of the strongest group
July 21, 2015
Data Mining: Concepts and Techniques
65
Associative Classification Can Achieve High
Accuracy and Efficiency (Cong et al. SIGMOD05)
July 21, 2015
Data Mining: Concepts and Techniques
66
Frequent Pattern-Based Classification
H. Cheng, X. Yan, J. Han, and C.-W. Hsu, “Discriminative
Frequent Pattern Analysis for Effective Classification”,
ICDE'07.
Accuracy issue
Increase the discriminative power
Increase the expressive power of the feature space
Scalability issue
It is computationally infeasible to generate all feature
combinations and filter them with an information gain
threshold
Efficient method (DDPMine: FPtree pruning): H. Cheng,
X. Yan, J. Han, and P. S. Yu, "Direct Discriminative
Pattern Mining for Effective Classification", ICDE'08.
July 21, 2015
Data Mining: Concepts and Techniques
67
Frequent Pattern vs. Single Feature
The discriminative power of some frequent patterns is
higher than that of single features.
(a) Austral
(b) Cleve
(c) Sonar
Fig. 1. Information Gain vs. Pattern Length
July 21, 2015
Data Mining: Concepts and Techniques
68
Empirical Results
Discriminative power of low-frequency patterns is bounded by a small value, due
to patterns’ limited coverage of the data set
Discriminative power of very-high frequency patterns is also bounded by a small
value, due to their commonness in the data
The information gain upper bound increases monotonically with pattern frequency
Thus, not every frequent pattern is useful
1
InfoGain
IG_UpperBnd
0.9
0.8
Information Gain
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0
100
200
300
400
500
600
700
Support
(a) Austral
(b) Breast
(c) Sonar
Fig. 2. Information Gain vs. Pattern Frequency
July 21, 2015
Data Mining: Concepts and Techniques
69
Feature Selection
Given a set of frequent patterns, both non-discriminative
and redundant patterns exist, which can cause overfitting
We want to single out the discriminative patterns and
remove redundant ones
General framework for discriminative frequent patternbased classification
Feature generation
July 21, 2015
The data D, are partitioned according to class label
Use frequent itemset mining to discover frequent patterns in
each partition, satisfying minimum support
The collection of frequent patterns F, make up the feature
candidates
Data Mining: Concepts and Techniques
70
Feature Selection
General framework (cont’d)
Feature selection
Apply feature selection to F, resulting in FS, the set of selected
(more discriminative) frequent patterns
Information gain, Fisher score, or other evaluation measures
can be used for this step
Relevancy checking to remove redundant patterns
The data set D is transformed to D’, where feature space now
includes the single features as well as the selected frequent
patterns FS
Learning of Classification model
A classifier is built on the data set D’ using any learning
algorithm as a classification model
71
Feature Selection
Computational bottleneck to first find all of the frequent
patterns and then analyze each one for selection
Mine only the highly discriminative ones – referred as
direct discriminative pattern mining (DDPMine)
Transform the data into FP-tree, which holds all of the
attribute-value association information
Next, search for discriminative patterns on the tree
FP-tree stores only the closed frequent patterns
The theoretical upper bound on information gain is used
to facilitate a branch-and-bound search, which prunes the
search space significantly
72
Experimental Results
July 21, 2015
Data Mining: Concepts and Techniques
73
Scalability Tests
July 21, 2015
Data Mining: Concepts and Techniques
74
DDPMine: Branch-and-Bound Search
sup(child) sup( parent)
sup(b) sup(a)
a
b
a: constant, a parent
node
b: variable, a descendent
2015/7/21
Association between information
gain and frequency
ICDM 08 Tutorial
75
DDPMine Efficiency: Runtime
PatClass
Harmony
PatClass: ICDE’07
Pattern
Classification Alg.
2015/7/21
DDPMine
ICDM 08 Tutorial
76
Chapter 9. Classification: Advanced Methods
Bayesian Belief Networks
Classification by Neural Networks
Support Vector Machines
Pattern-Based Classification
Lazy Learners (or Learning from Your Neighbors)
Other Classification Methods
Summary
July 21, 2015
Data Mining: Concepts and Techniques
77
Lazy vs. Eager Learning
Lazy vs. eager learning
Lazy learning (e.g., instance-based learning): Simply
stores training data (or only minor processing) and
waits until it is given a test tuple
Eager learning (the above discussed methods): Given
a set of training tuples, constructs a classification model
before receiving new (e.g., test) data to classify
Lazy: less time in training but more time in predicting
Accuracy
Lazy method effectively uses a richer hypothesis space
since it uses many local linear functions to form an
implicit global approximation to the target function
Eager: must commit to a single hypothesis that covers
the entire instance space
78
Lazy Learner: Instance-Based Methods
Instance-based learning:
Store training examples and delay the processing
(“lazy evaluation”) until a new instance must be
classified
Typical approaches
k-nearest neighbor approach
Instances represented as points in a Euclidean
space.
Locally weighted regression
Constructs local approximation
Case-based reasoning
Uses symbolic representations and knowledgebased inference
79
The k-Nearest Neighbor Algorithm
All instances correspond to points in the n-D space
When given an unknown tuple, a k-nearest neighbor
classifier searches the pattern space for the k training
tuples that are closest to the unknown tuple.
The nearest neighbor are defined in terms of
𝑛
2
Euclidean distance, dist(X1, X2) =
(𝑥
−
𝑥
)
1𝑖
2𝑖
𝑖=1
Values of each attribute are normalized before using in
the distance function
Voronoi diagram: the decision surface induced by 1NN for a typical set of training examples
.
_
_
_
+
_
_
. +
xq
+
_
+
.
.
.
.
80
The k-Nearest Neighbor Algorithm
The unknown tuple is assigned the most common class
among its k nearest neighbors
Target function could be discrete- or real- valued
For discrete-valued, k-NN returns the most common value
among the k training tuples nearest to xq
k-NN for real-valued prediction for a given unknown tuple
Returns the mean values of the k nearest neighbors
Distance-weighted nearest neighbor algorithm
Weight the contribution of each of the k neighbors
according to their distance to the query xq
w
Give greater weight to closer neighbors
1
d ( xq , x )2
i
Robust to noisy data by averaging k-nearest neighbors
81
Discussion on the k-NN Algorithm
Missing values
Assume maximum possible difference, i.e. 1 if values normalized to
[0,1]
If attribute A is numeric and only one value is missing, then take
the difference |1-v| or |0-v|, whichever is greater
Determining a good value for K
Start with k=1, use test set to estimate error rate of the classifier
Increment k and select the K with minimum error
Performance
If |D| tuples with k=1, O(|D|) comparisons to classify a test tuple
By presorting and arranging the stored tuples into search trees, the
number of comparisons can be reduced to O(log(|D|).
Parallel implementation can reduce the running time to a constant,
that is O(1), which is independent of |D|
82
Discussion on the k-NN Algorithm
Other methods to speed up classification time
Partial distance: compute the distance based on a
subset of the n attributes.
If this distance exceeds a threshold, then further computation
for the given stored tuple is halted, and the process moves on
to the next stored tuple
Editing: removes training tuples that prove useless.
This method is also referred to as pruning or condensing
because it reduces the total number of tuples stored
83
Case-Based Reasoning (CBR)
CBR: Uses a database of problem solutions to solve new
problems
Store symbolic description (of tuples or cases)—not points in
a Euclidean space, for problem solving
Applications: Customer-service (product-related diagnosis),
legal ruling
Methodology
Instances represented by rich symbolic descriptions (e.g., function
graphs)
Search for similar cases, multiple retrieved cases may be combined
If incompatibilities arise with the individual solutions, then
backtracking to search for other solutions may be necessary
Tight coupling between case retrieval, knowledge-based reasoning,
and problem solving
84
Case-Based Reasoning (CBR)
Challenges
Find a good similarity metric (e.g. matching subgraphs)
and suitable methods for combining solutions
Indexing based on syntactic similarity measure, and
when failure, backtracking, and adapting to additional
cases
85
Chapter 9. Classification: Advanced Methods
Bayesian Belief Networks
Classification by Neural Networks
Support Vector Machines
Pattern-Based Classification
Lazy Learners (or Learning from Your Neighbors)
Other Classification Methods
Summary
July 21, 2015
Data Mining: Concepts and Techniques
86
Genetic Algorithms (GA)
Genetic Algorithm: based on an analogy to biological evolution
An initial population is created consisting of randomly generated rules
Each rule is represented by a string of bits
E.g., if A1 and ¬A2 then C2 can be encoded as 100
If an attribute has k > 2 values, k bits can be used
Based on the notion of survival of the fittest, a new population is
formed to consist of the fittest rules and their offspring
The fitness of a rule is represented by its classification accuracy on a
set of training examples
Offspring are generated by crossover and mutation
The process continues until a population P evolves when each rule in P
satisfies a prespecified fitness threshold
Slow but easily parallelizable
87
Rough Set Approach
Rough sets are used to approximately or “roughly” define
equivalent classes within the given training data
All of the data tuples forming an equivalence class are indiscernible,
i.e., the samples are identical with respect to the attributes describing
the data
A rough set for a given class C is approximated by two sets: a lower
approximation (certain to be in C) and an upper approximation
(cannot be described as not belonging to C)
88
Rough Set Approach
Finding the minimal subsets (reducts) of attributes for
feature reduction is NP-hard but a discernibility matrix
(which stores the differences between attribute values for
each pair of data tuples) is used to reduce the
computation intensity
89
Fuzzy Set
Approaches
Fuzzy logic uses truth values between 0.0 and 1.0 to represent the
degree of membership (such as in a fuzzy membership graph)
Attribute values are converted to fuzzy values. Ex.:
Income, x, is assigned a fuzzy membership value to each of the
discrete categories {low, medium, high}, e.g. $49K belongs to
“medium income” with fuzzy value 0.15 but belongs to “high
income” with fuzzy value 0.96
Fuzzy membership values do not have to sum to 1.
Each applicable rule contributes a vote for membership in the
categories
Typically, the truth values for each predicted category are summed,
and these sums are combined
90
Multiclass and unlabeled data classification
Document classification, speech recognition, information
extraction – have unlabeled data
Examining and assigning a class-label by a human is time
consuming and expensive
Three approaches to classification of unlabeled data
Semi-supervised classification
Active learning
Builds a classifier using both labeled and unlabeled data
learning algorithm carefully selects a few of the unlabeled data
tuples and asks a human to label only those tuples
Transfer learning
aims to extract the knowledge from one or more source tasks
(like classifying camera reviews) and apply the knowledge to a
target task (like TV reviews)
91
Multiclass Classification
One-versus-all (OVA)
Given m classes, train m binary classifiers, one for each
class
Classifier j is trained using tuples of class j as the
positive class, and the remaining tuples as the negative
class
To classify an unknown tuple X, the set of classifiers
vote as an ensemble and the class with most votes is
assigned to X
All-versus-all (AVA)
Learns a classifier for each pair of classes
Given m classes, construct m(m-1)/2 binary classifiers
92
Multiclass Classification
All-versus-all (AVA)
A classifier is trained using tuples of the two classes it should
discriminate.
To classify an unknown tuple, each classifier votes.
The tuple is assigned the class with the maximum number of
votes.
All-versus-all tends to be superior to one-versus-all
Binary classifiers are sensitive to errors – affect vote count
Error-correcting codes
Error correcting codes provide redundancy to the data,
so that even if some individual binary classifiers make a
prediction error for an unknown tuple, it can be
correctly labeled
93
Multiclass Classification
Error-correcting codes
An error-correcting code is assigned to each class,
where each code is a bit vector
Train one classifier for each bit position
In case of an error by a classifier, Hamming distance
(# of different bits) is used to find the correct class
Example: Suppose that, given an unknown tuple to
label, the seven trained binary classifiers collectively
output the codeword 0001010, which does not match
a codeword for any of the four classes
Hamming distance
5
3
3
1 closest to codeword, class label
94
Semi-Supervised Classification
Semi-supervised classification uses labeled data and
unlabeled data to build a classifier.
Let Xl = {(x1, y1), . . . , (xl, yl)} be the set of labeled data
and Xu = {xl+1, . . . , xn} be the set of unlabeled data
Self-training: It first builds a classifier using the labeled
data, then tries to label the unlabeled data
The tuple with the most confident label prediction is
added to the set of labeled data, and the process repeats
Co-training: Two or more classifiers teach each other
Each learner uses a different and ideally independent set of features
for each tuple
Each set of features should be sufficient to train a good classifier
It may not be possible to split the features into mutually exclusive
and class-conditionally independent sets
95
Active Learning
Active learning is an iterative type of supervised learning
The algorithm queries a user for labels on a small number
of tuples
Pool-based approach: A small subset of data is class
labeled and a pool of unlabeled data
The active learner uses labeled data as training set and
a query function selects one or more data samples
from unlabeled pool and requests labels from expert
The newly labeled samples are added to labeled set
which is then used in a standard supervised way
The goal of the active learning is to achieve high
accuracy using as few labeled tuples as possible
96
Transfer Learning
Transfer learning aims to extract the knowledge from one
or more source tasks and apply the knowledge to a target
task
Example: classification model for camera reviews can be
used to classify TV reviews
Construction of the resulting classifier requires fewer
training data and less training time
97
Chapter 9. Classification: Advanced Methods
Bayesian Belief Networks
Classification by Neural Networks
Support Vector Machines
Pattern-Based Classification
Lazy Learners (or Learning from Your Neighbors)
Other Classification Methods
Summary
July 21, 2015
Data Mining: Concepts and Techniques
98
Summary (I)
Effective and scalable methods have been developed for
Bayesian belief network, backpropagation, Support Vector
Machine (SVM), pattern-based classification, nearest
neighbor classifiers, and case-based reasoning, and other
classification methods such as genetic algorithms, rough set
and fuzzy set approaches.
Unlike naive Bayesian classification (which assumes class
conditional independence), Bayesian belief networks
allow class conditional independencies to be defined
between subsets of variables.
99
Summary (II)
Backpropagation:
Neural network algorithm that uses gradient descent
Searches for a set of weights that model the data so as to minimize
the error between the network's class prediction and the actual
class label of data tuples
Rules can be extracted for improved interpretability
Support Vector Machine (SVM):
For classification of both linear and nonlinear data
Transforms original data into a higher dimension, from where it
finds a hyperplane for separation of the data using essential
training tuples called support vectors.
Pattern-Based Classification:
Uses association mining techniques that search for frequently
occurring patterns in large databases.
The patterns may generate rules, which can be analyzed for use in
classification.
100
Summary (III)
Lazy Learners:
store all training tuples and wait until presented with a
test tuple before performing generalization.
k-nearest neighbor and case-based reasoning
Genetic Algorithms: populations of rules “evolve” via
operations of crossover and mutation until all rules within a
population satisfy specified threshold.
Rough Set Approach: approximately define classes that
are not distinguishable based on the available attributes
Fuzzy Set Approaches: replace ``brittle'' threshold
cutoffs for continuous-valued attributes with degree of
membership functions.
July 21, 2015
Data Mining: Concepts and Techniques
101
References (1)
C. M. Bishop, Neural Networks for Pattern Recognition. Oxford
University Press, 1995.
C. J. C. Burges. A Tutorial on Support Vector Machines for
Pattern Recognition. Data Mining and Knowledge Discovery, 2(2):
121-168, 1998.
H. Cheng, X. Yan, J. Han, and C.-W. Hsu, Discriminative Frequent
pattern Analysis for Effective Classification, ICDE'07.
H. Cheng, X. Yan, J. Han, and P. S. Yu, Direct Discriminative
Pattern Mining for Effective Classification, ICDE'08.
N. Cristianini and J. Shawe-Taylor, Introduction to Support Vector
Machines and Other Kernel-Based Learning Methods,
Cambridge University Press, 2000.
A. J. Dobson. An Introduction to Generalized Linear Models.
Chapman & Hall, 1990.
G. Dong and J. Li. Efficient mining of emerging patterns:
Discovering trends and differences. KDD'99.
102
References (2)
R. O. Duda, P. E. Hart, and D. G. Stork. Pattern Classification, 2ed. John
Wiley, 2001
T. Hastie, R. Tibshirani, and J. Friedman. The Elements of Statistical
Learning: Data Mining, Inference, and Prediction. Springer-Verlag, 2001.
S. Haykin, Neural Networks and Learning Machines, Prentice Hall, 2008.
D. Heckerman, D. Geiger, and D. M. Chickering. Learning Bayesian
networks: The combination of knowledge and statistical data. Machine
Learning, 1995.
V. Kecman, Learning and Soft Computing: Support Vector Machines,
Neural Networks, and Fuzzy Logic, MIT Press, 2001.
W. Li, J. Han, and J. Pei, CMAR: Accurate and Efficient Classification
Based on Multiple Class-Association Rules, ICDM'01.
T.-S. Lim, W.-Y. Loh, and Y.-S. Shih. A comparison of prediction accuracy,
complexity, and training time of thirty-three old and new classification
algorithms. Machine Learning, 2000.
103
References (3)
B. Liu, W. Hsu, and Y. Ma. Integrating classification and association
rule mining, p. 80-86, KDD’98.
T. M. Mitchell. Machine Learning. McGraw Hill, 1997.
D.E. Rumelhart, and J.L. McClelland, editors, Parallel Distributed
Processing, MIT Press, 1986.
P. Tan, M. Steinbach, and V. Kumar. Introduction to Data Mining. Addison
Wesley, 2005.
S. M. Weiss and N. Indurkhya. Predictive Data Mining. Morgan Kaufmann,
1997.
I. H. Witten and E. Frank. Data Mining: Practical Machine Learning Tools
and Techniques, 2ed. Morgan Kaufmann, 2005.
X. Yin and J. Han. CPAR: Classification based on predictive association
rules. SDM'03
H. Yu, J. Yang, and J. Han. Classifying large data sets using SVM with
hierarchical clusters. KDD'03.
104