THREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS Manish Purohit - - PowerPoint PPT Presentation

three flavors of predictions in online algorithms
SMART_READER_LITE
LIVE PREVIEW

THREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS Manish Purohit - - PowerPoint PPT Presentation

THROUGH THE LENS OF SKI RENTAL THREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS Manish Purohit Joint work with Ravi Kumar, Zoya Svitkina, and Erik Vee OUTLINE Motivation Ski Rental Problem The Fortune Cookie The Weatherman


slide-1
SLIDE 1

THREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS

THROUGH THE LENS OF SKI RENTAL

Joint work with Ravi Kumar, Zoya Svitkina, and Erik Vee

Manish Purohit

slide-2
SLIDE 2

OUTLINE

  • Motivation
  • Ski Rental Problem
  • The Fortune Cookie
  • The Weatherman
  • The Constrained Adversary
  • Conclusions
slide-3
SLIDE 3

TACKLING UNCERTAINTY

  • Full input is unknown
  • Design algorithms for

worst-possible future

  • Pessimistic
  • Cannot exploit patterns /

predictability in data.

Online Algorithms

  • Observe past data
  • Build robust models to

predict the future

  • Highly successful!
  • Trained for good average

performance

  • Not robust to outliers

Machine Learning

slide-4
SLIDE 4

SKI RENTAL PROBLEM

  • Sam recently moved to Colorado
  • Renting : $1
  • Buying : $B
  • Should he rent or should he buy?
  • Missing: How often does Sam want to

ski?

slide-5
SLIDE 5

SKI RENTAL PROBLEM

  • Sam is very pessimistic and strongly

believes “Anything that can go wrong will go wrong”

  • Minimizes max$

%&' $ ()*($)

slide-6
SLIDE 6

SKI RENTAL PROBLEM

  • Minimizes max$

%&' $ ()*($)

  • Deterministic Algorithm:

– Buy on day B-1 – 2-competitive

  • Randomized Algorithm:

– Sample - ∈ 1, 1 ; 3 - ∝

5 567 867

– Buy on day - –

9 967-competitive

slide-7
SLIDE 7

THE FORTUNE COOKIE

  • Notation

– ! ← predicted number of days – # = % − ! = prediction error

  • Competitive Ratio

– Function of the error –

'() * +,- * ≤ / # 0

  • Consistency
  • Robustness

Algorithm is 1-consistent if / 0 = 1 Algorithm is 3-robust if / # ≤ 3 for all #

You will ski 26 times

slide-8
SLIDE 8

ATTEMPT 1

  • If ! ≥ #

– Buy on day 1

  • Else

– Rent every day

Blind Trust

slide-9
SLIDE 9

ATTEMPT 1

  • If ! ≥ #

– Buy on day 1

  • Else

– Rent every day

Blind Trust Analysis

If (! ≥ # and % ≥ #) or (! < # and % < #)

  • ./ = 123

If ! ≥ # and % < #

  • ./ = # ≤ % + ! − % = 123 + 7

If ! < # and % ≥ #

  • ./ = % ≤ # + % − ! = 123 + 7

b x y

slide-10
SLIDE 10

ATTEMPT 1

  • If ! ≥ #

– Buy on day 1

  • Else

– Rent every day

Blind Trust Analysis

If (! ≥ # and % ≥ #) or (! < # and % < #)

  • ./ = 123

If ! ≥ # and % < #

  • ./ = # ≤ % + ! − % = 123 + 7

If ! < # and % ≥ #

  • ./ = % ≤ # + % − ! = 123 + 7

b x y ALG OPT

slide-11
SLIDE 11

ATTEMPT 1

  • If ! ≥ #

– Buy on day 1

  • Else

– Rent every day

Blind Trust Analysis

If (! ≥ # and % ≥ #) or (! < # and % < #)

  • ./ = 123

If ! ≥ # and % < #

  • ./ = # ≤ % + ! − % = 123 + 7

If ! < # and % ≥ #

  • ./ = % ≤ # + % − ! = 123 + 7

b x y ALG OPT

slide-12
SLIDE 12

ATTEMPT 1

  • If ! ≥ #

– Buy on day 1

  • Else

– Rent every day

Blind Trust Analysis

If (! ≥ # and % ≥ #) or (! < # and % < #)

  • ./ = 123

If ! ≥ # and % < #

  • ./ = # ≤ % + ! − % = 123 + 7

If ! < # and % ≥ #

  • ./ = % ≤ # + % − ! = 123 + 7
  • ./ ≤ 123 + 7
slide-13
SLIDE 13

ATTEMPT 1

  • If ! ≥ #

– Buy on day 1

  • Else

– Rent every day

Blind Trust

1-consistent! Not Robust

! "

$%& ≤ ()* + ,

slide-14
SLIDE 14

ATTEMPT 2

  • Let ! ∈ 0,1 be a

hyperparameter

  • If & ≥ (

– Buy on day ⌈!(⌉

  • Else

– Buy on day

+ ,

Cautious Trust

  • ./

012 ≤ min

1 + ! +

8 9:, 012 , 9;, ,

Analysis

(1 + !)-consistent!

9;, ,

  • Robust

! !

slide-15
SLIDE 15

ATTEMPT 2

  • ! ∈ 0,1 gives a tradeoff

between consistency and robustness

  • Small !

– Higher trust in the predictions – Better consistency – Worse robustness

Cautious Trust

(1 + !)-consistent!

)*+ +

  • Robust
slide-16
SLIDE 16

ATTEMPT 2

  • ! ∈ 0,1 gives a tradeoff

between consistency and robustness

  • Small !

– Higher trust in the predictions – Better consistency – Worse robustness

Cautious Trust

(1 + !)-consistent!

)*+ +

  • Robust

Can we do better?

slide-17
SLIDE 17

ATTEMPT 3

  • Let’s randomize!
  • If ! ≥ #

– $ = ⌊'#⌋ – Define )* ←

,-. , /-*

. ,(. - . -./, 3)

– Choose 5 ∈ 1, 2, … , $ randomly from distribution defined by )*. – Buy on day j

  • Else

– ℓ =

, <

– Define =

* ← ,-. , ℓ-*

. ,(. - . -./, ℓ)

– Choose 5 ∈ 1, 2, … , ℓ randomly from distribution defined by =

*.

– Buy on day j

slide-18
SLIDE 18

ATTEMPT 3

  • Let’s randomize!
  • If ! ≥ #

– $ = ⌊'#⌋ – Define )* ←

,-. , /-*

. ,(. - . -./, 3)

– Choose 5 ∈ 1, 2, … , $ randomly from distribution defined by )*. – Buy on day j

  • Else

– ℓ =

, <

– Define =

* ← ,-. , ℓ-*

. ,(. - . -./, ℓ)

– Choose 5 ∈ 1, 2, … , ℓ randomly from distribution defined by =

*.

– Buy on day j

< . ->?@ -consistent! . .->? @?A

B

  • Robust
slide-19
SLIDE 19

THE FORTUNE COOKIE

You will ski 26 times

!"# $%& ≤ min + , -./0

1 +

3 $%& , , ,-./ 0/5

6

Prediction Error Consistency Robustness

slide-20
SLIDE 20

OUTLINE

  • Motivation
  • Ski Rental Problem
  • The Fortune Cookie
  • The Weatherman
  • The Constrained Adversary
  • Conclusions
slide-21
SLIDE 21

THE WEATHERMAN

  • Predictions are backed by a probabilistic guarantee
  • The algorithm can utilize these error probabilities to
  • btain better performance
slide-22
SLIDE 22

THE WEATHERMAN FOR SKI RENTAL

  • Suppose we train a binary classifier to predict whether Sam will ski

for more than b days or not

  • ℎ ← probability of correct prediction
  • The algorithm knows ℎ

(say, by observing performance on validation data)

  • What algorithms can we obtain in this setting?
slide-23
SLIDE 23

THE WEATHERMAN FOR SKI RENTAL

  • If prediction < b days

– Buy on day b

  • If prediction more than b days

– Buy on day ! with probability "#

Minimize $ subject to ∀&, ( )*+ & ≤ $ min(1, &)

slide-24
SLIDE 24

THE WEATHERMAN FOR SKI RENTAL

  • If prediction < b days

– Buy on day b

  • If prediction more than b days

– Buy on day ! with probability "#

Minimize $ subject to ∀&, ( )*+ & ≤ $ min(1, &) h Competitive ratio

slide-25
SLIDE 25

THE WEATHERMAN

h

Competitive ratio

competitive ratio= "(ℎ) " 1 = 1, "

( ) = * *+(

slide-26
SLIDE 26

OUTLINE

  • Motivation
  • Ski Rental Problem
  • The Fortune Cookie
  • The Weatherman
  • The Constrained Adversary
  • Conclusions
slide-27
SLIDE 27

THE CONSTRAINED ADVERSARY

  • Bound the amount of uncertainty
  • Make structural assumptions about

the online input

  • More structure → Better guarantees
slide-28
SLIDE 28

THE CONSTRAINED ADVERSARY

  • More convenient to work with

fractional version of the problem

  • Costs 1 to buy skis
  • Costs ! to rent for ! time (fractional)
  • Constraint: " ≥ $
  • “Sam knows he’ll ski at least five

times”

slide-29
SLIDE 29

THE CONSTRAINED ADVERSARY

  • Let !" # ← Probability of buying on day z
  • Let 4 5

← Probability of buying on the 8irst day

  • Say we enforce !" # = 0, ∀# > 1

(Even the deterministic algorithm does that)

  • What’s the expected algorithm cost for @ days?
  • ABCD" @ = 4 5 + ∫

G H 1 + # !" # I# + ∫ H J @!" # I#

  • Set probabilities so that

KLMNO H PQR(H,J) is a constant

slide-30
SLIDE 30

THE CONSTRAINED ADVERSARY

  • Let !" # ← Probability of buying on day z
  • Let 4 5

← Probability of buying on the 8irst day

  • Say we enforce !" # = 0, ∀# > 1

(Even the deterministic algorithm does that)

  • What’s the expected algorithm cost for @ days?
  • ABCD" @ = 4 5 + ∫

G H 1 + # !" # I# + ∫ H J @!" # I#

  • Set probabilities so that

KLMNO H PQR(H,J) is a constant

There exists a randomized algorithm with competitive ratio U U V JV" UO

slide-31
SLIDE 31

CONCLUSIONS

  • The Fortune Cookie

– Predictions with no error guarantees – Competitive ratio = min(consistency, robustness)

  • The Weatherman

– Predicts with error guarantees – Competitive ratio = function(error probability)

  • The Constrained Adversary (Semi-Online)

– Structural assumptions about input – Improved competitive ratios

slide-32
SLIDE 32

THANKS!