Docsity

Bioinformatics: Microarray Data Analysis & Naïve Bayes Classifier, Study notes of Electrical and Electronics Engineering

Toggle sidebar
bg1
1
2006-4-13 A. Y. Zhang, University of Kansas 1
EEC EECS 690
Introduction to Bioinformatics
Microarray Data Analysis III
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
zClassification
zK-nearest neighbor classifier
zDecision tree learning
zNaïve Bayes classifier
2006-4-13 A. Y. Zhang, University of Kansas 3
Review: Self-Organizing Map (SOM)
zThe SOM works both as a projection (Visualization)
method and a clustering method
zMaps high-dimensional input data onto a low-
dimensional (usually two-dimensional) output space
while preserving the topological relationships
between the input data
zConstraint version of K-means clustering
zPrototypes lie in a one- or two-dimensional manifold
zK prototypes: Rectangular grid, hexagonal grid
2006-4-13 A. Y. Zhang, University of Kansas 4
Page 211
Review: Principal components
analysis (PCA)
zPCA
zProject the high-dimensional points in a low dimensional
space while preserving the “essence” of the data
zA “better” coordinate system for the data
zPCA objective
zTo reduce dimensionality
zTo reduce redundancies in the data
zTo choose the most useful variables (features)
zTo visualize multidimensional data
zTo identify groups of objects (e.g. genes/samples)
zTo 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
Example: Tumor Classification
zCurrent methods for classifying human tumor
mainly rely on a variety of morphological, clinical
and molecular variables
zMicroarray allows the characterization of
molecular variations among tumors by
monitoring gene expression
zHope: microarray will lead to more reliable tumor
classification (and therefore more appropriate
treatments and better outcomes)
pf3
pf4
pf5

Partial preview of the text

Download Bioinformatics: Microarray Data Analysis & Naïve Bayes Classifier and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

2006-4-13 A. Y. Zhang, University of Kansas 1

EEC EECS 690

Introduction to Bioinformatics

Microarray Data Analysis III

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

z Classification

z K-nearest neighbor classifier

z Decision tree learning

z Naïve Bayes classifier

2006-4-13 A. Y. Zhang, University of Kansas 3

Review: Self-Organizing Map (SOM)

z The SOM works both as a projection (Visualization)

method and a clustering method

z Maps high-dimensional input data onto a low-

dimensional (usually two-dimensional) output space

while preserving the topological relationships

between the input data

z Constraint version of K-means clustering

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

Review: Principal components

analysis (PCA)

z PCA

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 PCA objective

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

Example: Tumor Classification

z Current methods for classifying human tumor

mainly rely on a variety of morphological, clinical

and molecular variables

z Microarray allows the characterization of

molecular variations among tumors by

monitoring gene expression

z Hope: microarray will lead to more reliable tumor

classification (and therefore more appropriate

treatments and better outcomes)

2006-4-13 A. Y. Zhang, University of Kansas 7

Example: Tumor Classification

z Data: gene expression of the tumor tissue from

cancer patients and gene expression of the

normal tissue from normal persons

z Task: to learn a model from the above data

that can be used to predict the status of a

person based on his expression profile

z Solution: ??

2006-4-13 A. Y. Zhang, University of Kansas 8

z Data: A set of data records (also called examples,

instances or cases) described by

z k attributes: A 1 , A 2 , … A (^) k. z a class: Each example is labelled with a pre-defined class.

z Goal: To learn a classification model from the data

that can be used to predict the classes of new

(future, or test) cases/instances.

z Supervised learning: classes are predefined, use a

(training or learning) set of labeled objects to form a

classifier for classification of future observations

Classification

2006-4-13 A. Y. Zhang, University of Kansas 9

General model of classification

z Given input X, output Y

z Want to estimate the function f based on

known data set (training data)

unknown

2006-4-13 A. Y. Zhang, University of Kansas 10

Classification—A Two-Step Process

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:

z K-Nearest Neighbor

z Decision tree learning

z Naïve Bayes

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

Algorithm for decision tree learning

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

Choose an attribute to

partition data

z The key to building a decision tree - which

attribute to choose in order to branch.

z The objective is to reduce impurity or

uncertainty in data as much as possible.

z A subset of data is pure if all instances belong to

the same class.

z The heuristic in C4.5 is to choose the attribute

with the maximum Information Gain or Gain

Ratio based on information theory.

2006-4-13 A. Y. Zhang, University of Kansas 21

Information theory: Entropy

measure

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!

Pr( ) 1 ,

( ) Pr( )logPr( )

||

1

||

1

2

=

=

C

j

j

j

C

j

j

c

entropyD c c

2006-4-13 A. Y. Zhang, University of Kansas 22

Information gain

z Given a set of examples D , we first compute its

entropy:

z If we make attribute Ai , with v values, the root of the

current tree, this will partition D into v subsets D 1 , D 2

…, D v. The expected entropy if Ai is used as the

current root:

=

= ×

v

j

j

j

A entropyD

D

D

entropy D

i 1

= =

| |

1

||

1

( ) Pr( )log 2 Pr( ), Pr( ) 1

C

j

j j

C

j

entropyD cj c c

2006-4-13 A. Y. Zhang, University of Kansas 23

Information gain (cont …)

z Information gained by selecting attribute Ai to

branch or to partition the data is

z We choose the attribute with the highest gain to

branch/split the current tree.

gain ( D , Ai )= entropy ( D )− entropyAi ( D )

2006-4-13 A. Y. Zhang, University of Kansas 24

Example - Training Dataset

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

An example

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?

„ No. Here is a simpler tree.

„ We want smaller tree and accurate tree.

„ Easy to understand and perform better.

„ Finding the best tree is NP-hard.

„ All current tree building algorithms

are heuristic algorithms

2006-4-13 A. Y. Zhang, University of Kansas 29

Avoid overfitting in classification

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

z Bayes rule

z Suppose X =[ X 1 ,…, X n ]

z When Y is Boolean and X is a vector of n Boolean

attributes Æ 2 n+1^ parameters to estimate!

z Naïve bayes assumes

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

Naïve Bayes classifier: Example --

Classify DNA Sequences

z Classify which DNA sequence contains splice

site

z Classify which DNA sequence encodes protein

z …

z How to represent the DNA sequence for naïve

bayes?

2006-4-13 A. Y. Zhang, University of Kansas 39

Naïve Bayes classifier: Example --

Classify DNA Sequences

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

Naïve Bayes classifier: Example --

Classify DNA Sequences

+: 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 )