



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




2006-4-13 A. Y. Zhang, University of Kansas 1
Anne Y. Zhang Electrical Engineering and Computer Science http://people.eecs.ku.edu/~yazhang/
2006-4-13 A. Y. Zhang, University of Kansas 2
Outline
2006-4-13 A. Y. Zhang, University of Kansas 3
z Prototypes lie in a one- or two-dimensional manifold z K prototypes: Rectangular grid, hexagonal grid
2006-4-13 A. Y. Zhang, University of Kansas 4 Page 211
z Project the high-dimensional points in a low dimensional space while preserving the “essence” of the data z A “better” coordinate system for the data
z To reduce dimensionality z To reduce redundancies in the data z To choose the most useful variables (features) z To visualize multidimensional data z To identify groups of objects (e.g. genes/samples) z To identify outliers
2006-4-13 A. Y. Zhang, University of Kansas 5
Microarray Data Analysis
Unsupervised Learning (Clustering) Class Discovery
Supervised Learning (Classification)
Class Prediction
Finding previously unrecognized structure
Finding distinctions between groups Hierarchical clustering K-means clustering GMM clustering SOM PCA
K-Nearest Neighbor Decision tree learning Naïve Bayes classifier Support Vector Machines
2006-4-13 A. Y. Zhang, University of Kansas 6
2006-4-13 A. Y. Zhang, University of Kansas 7
Example: Tumor Classification
2006-4-13 A. Y. Zhang, University of Kansas 8
z k attributes: A 1 , A 2 , … A (^) k. z a class: Each example is labelled with a pre-defined class.
Classification
2006-4-13 A. Y. Zhang, University of Kansas 9
unknown
2006-4-13 A. Y. Zhang, University of Kansas 10
z Model construction: describing a set of predetermined classes z Each sample is assumed to belong to a predefined class, as determined by the class label z The set of samples used for model construction: training set z The model is represented as classification rules, decision trees, or mathematical formulae z Model usage: for classifying future or unknown objects z Estimate accuracy of the model z The known label of test sample is compared with the classified result from the model z Accuracy rate is the percentage of test set samples that are correctly classified by the model z Test set is independent of training set
2006-4-13 A. Y. Zhang, University of Kansas 11
Approaches:
2006-4-13 A. Y. Zhang, University of Kansas 12
K Nearest Neighbor z Majority vote within the k nearest neighbors
K= 1: brown K= 3: green
z k-NN requires a parameter k and a new distance metric. z For k = 1, training error is zero, but test error could be large. z As k↑, training error tends to increase, but test error tends to decrease first, and then tends to increase. z For a reasonable k, both the training and test errors could be smaller than the Linear decision boundary.
2006-4-13 A. Y. Zhang, University of Kansas 19
z Basic algorithm (a greedy divide-and-conquer algorithm) z Assume attributes are categorical now (continuous attributes can be handled too) z Tree is constructed in a top-down recursive manner z At start, all the training examples are at the root z Examples are partitioned recursively based on selected attributes z Attributes are selected on the basis of an impurity function (e.g., information gain)
z Conditions for stopping partitioning z All examples for a given node belong to the same class z There are no remaining attributes for further partitioning – majority class is the leaf z There are no examples left 2006-4-13 A. Y. Zhang, University of Kansas 20
2006-4-13 A. Y. Zhang, University of Kansas 21
z The entropy formula,
z Pr( c (^) j ) is the probability of class c (^) j in data set D z We use entropy as a measure of impurity or disorder of data set D. (Or, a measure of information in a tree) As the data become purer and purer, the entropy value becomes smaller and smaller. This is useful to us!
||
1
||
1
2
=
=
C
j
j
j
C
j
j
2006-4-13 A. Y. Zhang, University of Kansas 22
=
v
j
j
j
i 1
= =
| |
1
||
1
C
j
j j
C
j
2006-4-13 A. Y. Zhang, University of Kansas 23
2006-4-13 A. Y. Zhang, University of Kansas 24
gene1 gene2 cancer? <2 <2 no <2 <2 no <2 >2 yes
2 >2 yes 2 <2 yes <2 <2 no <2 <2 no <2 <2 yes 2 >2 yes <2 >2 yes
2006-4-13 A. Y. Zhang, University of Kansas 25
10
4 log 10
4 10
6 log 10
6 entropy ( D )=− × 2 − × 2 =
0 10
0.9183^4 10
6
( ) 10
4 ( ) 10
6 2 (^ ) 1 2
=
= × + ×
entropygeneD = − × entropyD − × entropyD
0 10
3
10
7
( ) 10
()^3 10
( )^7 1 1 2
=
= × + ×
entropygeneD = − × entropyD − × entropyD
gain ( D , gene 1 )= entropy ( D )− entropygene 1 ( D )= 0.
gain ( D , gene 2 )= entropy ( D )− entropygene 2 ( D )= 0.
Choose Gene2 as split!
2006-4-13 A. Y. Zhang, University of Kansas 26
We build the final tree
gene
gene
no yes
yes
2006-4-13 A. Y. Zhang, University of Kansas 27
Use the decision tree
gene2^ yes
gene
no yes
yes
gene1 gene2 cancer? New patient: >2 <2 ??
2006-4-13 A. Y. Zhang, University of Kansas 28
Is the decision tree unique?
Easy to understand and perform better.
2006-4-13 A. Y. Zhang, University of Kansas 29
z Overfitting: A tree may overfit the training data z Good accuracy on training data but poor on test data z Symptoms: tree too deep and too many branches, some may reflect anomalies due to noise or outliers z Two approaches to avoid overfitting z Pre-pruning: Halt tree construction early z Difficult to decide because we do not know what may happen subsequently if we keep growing the tree. z Post-pruning: Remove branches or sub-trees from a “fully grown” tree. z This method is commonly used. C4.5 uses a statistical method to estimates the errors at each node for pruning. z A validation set may be used for pruning as well.
2006-4-13 A. Y. Zhang, University of Kansas 30
Naïve Bayes Classifier
X (^) i and X (^) j are conditionally independent, given Y
2006-4-13 A. Y. Zhang, University of Kansas 37
Naïve Bayes classifier:
Example – Cancer diagnosis
gene1 gene2 cancer? <2 <2 no <2 <2 no <2 >2 yes
2 >2 yes 2 <2 yes <2 <2 no <2 <2 no <2 <2 yes 2 >2 yes <2 >2 yes
gene1 gene2 cancer?
2 <2 ??
New patient:
Training data
PnPgene nPgene n
PyPgene yPgene y
Pgene n
Pgene y
Pgene n
Pgene y
Py Pn
2006-4-13 A. Y. Zhang, University of Kansas 38
2006-4-13 A. Y. Zhang, University of Kansas 39
Target concept: DNA sequence Æ {+,-} z Represent each sequence by vector of letters z One attribute per position in the sequence z Learning: use training examples to estimate z P(+) z P(-) z P(Seq|+) z P(Seq|-) z Naïve Bayes conditional independence assumption
P ( xi = wk | yj )= P ( xm = wk | yj ),∀ i , m
=
( )
1
length Seq
i
p Seqyj Pxi wk yj
Probability that letter in position i is wk , given y (^) j k =4 (A,T,C,G)
2006-4-13 A. Y. Zhang, University of Kansas 40
+: CTGTCCTGTG +: ACGTTTCAAA +: CTACCCTGCG +: TGTGACGCGT -: GATATGTCTC -: AGCGAGGTGT -: TGGTGAATTC -: CTACCTCAAG
Calculate P(+), P(-) P( x (^) i |+), and P( x (^) i |-)
P(+)=0. P(-)=0. P( x 1 =A |+)=0.25 ; P( x 1 =T |+)=0. P( x 2 =T |+)=0.5 ; P( x 2 =C |+)=0. …
∏ ∈ (^) x ∈ x j i j y (^) jV i
argmax P ˆ ( y ) P ˆ( x | y )