Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q 3 . The promises and pitfalls of randomization in sequence prediction ( 2 5 points ) . We have learned in class that the

Q3. The promises and pitfalls of randomization in sequence prediction (25
points). We have learned in class that the weighted majority algorithm (WMA) and the
randomized weighted majority algorithm (R-WMA) share some key similarities: both of
them place weights on experts that become lower as experts make more inaccurate forecasts.
The key difference arises in how the algorithms aggregate the weights to make a prediction:
while WMA deterministically goes with the majority vote, RWMA randomizes its prediction
proportional to the weight on each expert. In this problem, you will implement both algo-
rithms in code and examine the implications of randomization on an "easy", i.e. predictable
sequence and a "hard", i.e. unpredictable/adversarial sequence.
(a)(10 points) Use the starter code provided in the Jupyter notebook "Q3.ipynb" to
implement the WMA and RWMA algorithms with the parameter choice lon=14 for
an arbitrary sequence y1,dots,yT. Your code for each algorithm should consist of 3
components: i) the prediction rule xt(or prediction probability pt in the case of RWMA)
at round t, ii) the evaluation of loss or mistakes, iii) the weight update from round t
to round t+1.
(b)(5 points) Use your starter code to return the sequence of cumulative mistakes up to
round t, i.e.Mt=s=1tms as a function of t(where t ranges from 1 to T) for the
"easy" and "hard" sequences, which are pre-loaded into the Jupyter notebook. Plot
Mt as a function of t for each sequence comparing WMA and RWMA. You should
return two plots, one comparing WMA and RWMA for the easy sequence and the
other comparing WMA and RWMA for the hard sequence.
(c)(5 points) Which algorithm is better for the easy sequence and which algorithm is
better for the hard sequence?
(d)(5 points) Write code to calculate the eventual regret RT for WMA and RWMA for
the easy and hard sequence respectively. Which algorithm incurs a lower regret for
each case? Suppose Nature gave you the easy sequence with probability 12 and the
hard sequence with probability 12. Should you use the randomized WMA or WMA?
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

6th International Edition

061921323X, 978-0619213237

More Books

Students also viewed these Databases questions

Question

4-31. We will be opening our new facility sometime this spring.

Answered: 1 week ago