csc321 tutorial 6: part 1: recurrent neural network part 2

13
CSC321 Tutorial 6: Part 1: recurrent neural network Part 2: combining models (Bagging & AdaBoost) Yue Li Email: [email protected] Wed 11-12 Feb 26 Fri 10-11 Feb 28

Upload: others

Post on 24-May-2022

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CSC321 Tutorial 6: Part 1: recurrent neural network Part 2

CSC321 Tutorial 6:Part 1: recurrent neural network

Part 2: combining models (Bagging & AdaBoost)

Yue LiEmail: [email protected]

Wed 11-12 Feb 26Fri 10-11 Feb 28

Page 2: CSC321 Tutorial 6: Part 1: recurrent neural network Part 2

Part 1 Recurrent neural network; see handwritten notes:http://www.cs.utoronto.ca/~yueli/CSC321_UTM_2014_

files/tut6_rnn.pdf

Materials are based on course readings: Learning internalrepresentations by error propagation, pp 354-362:http://www.cs.toronto.edu/~hinton/absps/pdp8.pdf

Page 3: CSC321 Tutorial 6: Part 1: recurrent neural network Part 2

Part 2 combining models: Bagging (Breiman, 1996)General idea:

1. Sample with replacement (aka bootstrap) N ′1, . . . ,N

′m data

points from the original N data points X = {x1, . . . , xN};(input) Y = {y1, . . . , yN} (response)

2. Train m models fj (j ∈ {1, . . . ,m}) on the N ′1, . . . ,N

′m data

3. Perform prediction on new test data xi to predict yi :

For continuous yj :

yj =1

m

m∑j=1

fj(xi ,θj)

For discrete yj :

yj = arg maxk

∑j

I (fj(xi ,θj), k)

where I (fm(xj ,θj), k) returns 1 if fm(xj ,θj) = k ; 0 otherwise

Page 4: CSC321 Tutorial 6: Part 1: recurrent neural network Part 2

Why does Bagging work?• Effective on “unstable” learning algorithms where small

changes in the training set result in large changes inpredictions (Breiman, 1996)

http://en.wikipedia.org/wiki/Bootstrap_aggregating

Page 5: CSC321 Tutorial 6: Part 1: recurrent neural network Part 2

Wisdom of crowds for robust gene network inference (DREAM5)(Marbach et al. (2012). Nature Methods, 9(8), 796-804)

123456789

101112131415161718192021222324

Team 2 Rank

A

B

C

X

Y

Z

Team 1

B

C

A

XYZ

Team 3

A

B

C

X

Y

Z

Positives (interacting gene pairs)Negatives (non-interacting pairs)

a

0

0.02

0.04

Prob

abilit

y

0

0.02

0.04

Prob

abilit

y

1 20 40 60 80 1000

0.04

0.08

Prob

abilit

y

Average rank

1 method

Integrating 5 methods

Integrating 30 methods

AUPR = 0.41

AUPR = 0.66

AUPR = 0.97

Interactinggene pairs Non-interacting

gene pairs

b

c

d

Figure S12: Why community integration can outperform the best individual inference methods(a) A hypothetical example of predictions submitted by 3 separate teams. The challenge is to integrate predictionsmade by each team into a single ranked list. (b-d) Two sufficient conditions for integration to outperform individualinference methods are: (1) each of the inference methods must have better than random predictive power (i.e., on averageinteracting pairs are assigned better ranks than non-interacting pairs); and (2) predictions of different inference methodsmust be statistically independent.24 For illustrative purpose, we consider a simple scenario comprising T=100 candidatetranscription factor-gene pairs, out of which P=30 interact and N=70 do not interact. For instance, individual inferencemethods that assign ranks to interacting and non-interacting pairs with the probabilities shown in Panel b sufficecondition (1). Although interacting pairs are assigned better ranks on average, the probability of incorrect predictions(non-interacting pairs in the top-part or interacting pairs in the bottom-part of the prediction list) is considerable inthis example, resulting in an AUPR of only 0.41 (for a random prediction, we expect AUPR=P/T=0.3). (c, d) If theassigned ranks are independent across methods (condition 2), the central limit theorem establishes that the averagerank distribution will approach a Gaussian distribution. Its variance shrinks as more methods are integrated, therebyincreasingly segregating interacting from non-interacting transcription factor-gene pairs (Panels b ! d). Consequently,the probability that interacting pairs are ranked better than non-interacting pairs increases, resulting in an AUPR thattends to 1 (perfect prediction) as the number of integrated inference methods increases. Even though all predictionsare based on the same datasets in the DREAM challenge, and are thus not statistically independent, we have shownthat diversity arises due to method-specific capabilities to extract different kinds of information from the data (Fig. 2).Methods from different classes show greater levels of independence and thus contribute more to community performance(Figs. 2b and 3c). Since predictions are partially, but not completely independent, the AUPR increases as more methodsare integrated (Fig. 3a) but tends to a value lower than 1 in practice.

19Nature Methods: doi:10.1038/nmeth.2016

Average ranking: rBorda(I ) =1K

∑Kj=1 rj (I )

Page 6: CSC321 Tutorial 6: Part 1: recurrent neural network Part 2

AdaBoost general idea

• Given training data X = {x1, . . . , xN} with labelsY = {y1, . . . , yN}, where yi ∈ {−1,+1}e.g., eye detection in an image of D pixels xi , where yi = +1is eye; yi = −1 for non-eye;

• Task: Seek a strong classifier by combining K weak classifiersto predict yi from the training data as accurate as possible

• Intuition: Mistakes made by the kth weak classifier should betaken more seriously by the (k + 1)th classifier

• NB: The weak classifiers must be reasonably better thanrandom guess (i.e., more accurate than 50% chance of makinga right/wrong decision by tossing a coin)

Page 7: CSC321 Tutorial 6: Part 1: recurrent neural network Part 2

Algorithm 1 AdaBoostfor k = 1 to K classifiers do

Fit weak classifier k to minimize the objective function:

εk =

∑i w

(k)i I [fk(xi ,θk) 6= yi ]∑

i w(k)i

(1)

αk = ln(1− εkεk

) > 0 (2)

for i = 1 to N training cases do

w(k+1)i = w

(k)i eαk I [fk (xi ,θk ) 6=yi ] (3)

end forend forFinal prediction:

yi = sign

(∑k

αk fk(xi ,θk)

)(4)

Page 8: CSC321 Tutorial 6: Part 1: recurrent neural network Part 2

Toy ExampleToy ExampleToy ExampleToy ExampleToy Example

D1

Page 9: CSC321 Tutorial 6: Part 1: recurrent neural network Part 2

Round 1Round 1Round 1Round 1Round 1

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

����������������������������������������������������������������������������������������������������������������������������

����������������������������������������������������������������������������������������������������������������������������

2D

h1

α

ε1

1

=0.30

=0.42

Page 10: CSC321 Tutorial 6: Part 1: recurrent neural network Part 2

Round 2Round 2Round 2Round 2Round 2

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

�����������������������������������������������������������������������������������������������������������������������������������������������������������

�����������������������������������������������������������������������������������������������������������������������������������������������������������

����������������������������������������������������������������������������������������������������������������������������

����������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

α

ε2

2

=0.21

=0.65

h2

3D

Page 11: CSC321 Tutorial 6: Part 1: recurrent neural network Part 2

Round 3Round 3Round 3Round 3Round 3

������������������������������������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������������������������������������������

����������������������������������������������������������������������������������������������������������������������������

����������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

�����������������������������������������������������������������������������������������������������������������������������������������������������������

�����������������������������������������������������������������������������������������������������������������������������������������������������������

h3

α

ε3

3=0.92

=0.14

Page 12: CSC321 Tutorial 6: Part 1: recurrent neural network Part 2

Final HypothesisFinal HypothesisFinal HypothesisFinal HypothesisFinal Hypothesis

������������������������������������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

����������������������������������

����������������������������������

����������������������������������������������������������������������������������������������������������������������������������������

����������������������������������������������������������������������������������������������������������������������������������������

���������������������������������������������������������������������������������������������������

������������������������������������������������������������������������������������������������������������������������������������������������

���������������������������������������������

����������������������������������

����������������������������������

�����������������������������������������������������������������������������������������������������������������������

�����������������������������������������������������������������������������������������������������������������������

����������������������������������������������������������������������������������������������������������������������������������

����������������������������������������������������������������������������������������������������������������������������������

=

= sign

Hfinal

+ 0.92+ 0.650.42

* See demo atwww.research.att.com/˜yoav/adaboost

Page 13: CSC321 Tutorial 6: Part 1: recurrent neural network Part 2

TA office hours before midterm:12-1:30 March 5 (Wednesday next week) at DV1160