![Page 1: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/1.jpg)
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
![Page 2: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/2.jpg)
OUTLINE• Mot iva t ion
• Sk i Renta l P rob lem
• The For tune Cook ie
• The Weatherman
• The Cons t ra ined Adversa ry
• Conc lus ions
![Page 3: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/3.jpg)
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
![Page 4: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/4.jpg)
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?
![Page 5: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/5.jpg)
SKI RENTAL PROBLEM
• Sam is very pessimistic and strongly believes “Anything that can go wrong will go wrong”
• Minimizes max$ %&' $()*($)
![Page 6: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/6.jpg)
SKI RENTAL PROBLEM• Minimizes max$ %&' $
()*($)
• Deterministic Algorithm:– Buy on day B-1– 2-competitive
• Randomized Algorithm:
– Sample - ∈ 1, 1 ; 3 - ∝ 5567
867
– Buy on day -– 9
967-competitive
![Page 7: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/7.jpg)
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
![Page 8: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/8.jpg)
ATTEMPT 1
• If ! ≥ #– Buy on day 1
• Else– Rent every day
B l ind Trus t
![Page 9: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/9.jpg)
ATTEMPT 1
• If ! ≥ #– Buy on day 1
• Else– Rent every day
B l ind Trus t Ana lys i s
If (! ≥ # and % ≥ #) or (! < # and % < #)-./ = 123
If ! ≥ # and % < #-./ = # ≤ % + ! − % = 123 + 7
If ! < # and % ≥ #-./ = % ≤ # + % − ! = 123 + 7
0 b x y
![Page 10: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/10.jpg)
ATTEMPT 1
• If ! ≥ #– Buy on day 1
• Else– Rent every day
B l ind Trus t Ana lys i s
If (! ≥ # and % ≥ #) or (! < # and % < #)-./ = 123
If ! ≥ # and % < #-./ = # ≤ % + ! − % = 123 + 7
If ! < # and % ≥ #-./ = % ≤ # + % − ! = 123 + 7
0 bx y
ALGOPT
![Page 11: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/11.jpg)
ATTEMPT 1
• If ! ≥ #– Buy on day 1
• Else– Rent every day
B l ind Trus t Ana lys i s
If (! ≥ # and % ≥ #) or (! < # and % < #)-./ = 123
If ! ≥ # and % < #-./ = # ≤ % + ! − % = 123 + 7
If ! < # and % ≥ #-./ = % ≤ # + % − ! = 123 + 7
0 b xy
ALGOPT
![Page 12: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/12.jpg)
ATTEMPT 1
• If ! ≥ #– Buy on day 1
• Else– Rent every day
B l ind Trus t Ana lys i s
If (! ≥ # and % ≥ #) or (! < # and % < #)-./ = 123
If ! ≥ # and % < #-./ = # ≤ % + ! − % = 123 + 7
If ! < # and % ≥ #-./ = % ≤ # + % − ! = 123 + 7
-./ ≤ 123 + 7
![Page 13: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/13.jpg)
ATTEMPT 1
• If ! ≥ #– Buy on day 1
• Else– Rent every day
B l ind Trus t
1-consistent!
Not Robust
!
"
$%& ≤ ()* + ,
![Page 14: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/14.jpg)
ATTEMPT 2
• Let ! ∈ 0,1 be a hyperparameter
• If & ≥ (– Buy on day ⌈!(⌉
• Else
– Buy on day+,
Caut ious Trus t
-./012 ≤ min 1 + ! + 8
9:, 012 ,9;,,
Ana lys i s
(1 + !)-consistent! 9;,, -Robust
! !
![Page 15: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/15.jpg)
ATTEMPT 2
• ! ∈ 0,1 gives a tradeoff between consistency and robustness
• Small !– Higher trust in the predictions– Better consistency– Worse robustness
Caut ious Trus t (1 + !)-consistent! )*++ -Robust
![Page 16: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/16.jpg)
ATTEMPT 2
• ! ∈ 0,1 gives a tradeoff between consistency and robustness
• Small !– Higher trust in the predictions– Better consistency– Worse robustness
Caut ious Trus t (1 + !)-consistent! )*++ -Robust
Can we do better?
![Page 17: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/17.jpg)
ATTEMPT 3• Let’s randomize!
• If ! ≥ #– $ = ⌊'#⌋– Define )* ← ,-.
,/-*
⋅ .,(. - . -./, 3)
– Choose 5 ∈ 1, 2, … , $ randomly fromdistribution defined by )*.
– Buy on day j• Else
– ℓ = ,<
– Define =* ← ,-.,
ℓ-*⋅ .,(. - . -./, ℓ)
– Choose 5 ∈ 1, 2, … , ℓ randomly fromdistribution defined by =*.
– Buy on day j
![Page 18: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/18.jpg)
ATTEMPT 3• Let’s randomize!
• If ! ≥ #– $ = ⌊'#⌋– Define )* ← ,-.
,/-*
⋅ .,(. - . -./, 3)
– Choose 5 ∈ 1, 2, … , $ randomly fromdistribution defined by )*.
– Buy on day j• Else
– ℓ = ,<
– Define =* ← ,-.,
ℓ-*⋅ .,(. - . -./, ℓ)
– Choose 5 ∈ 1, 2, … , ℓ randomly fromdistribution defined by =*.
– Buy on day j
<. ->?@ -consistent!
..->? @?AB
-Robust
![Page 19: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/19.jpg)
THE FORTUNE COOKIE
You will ski 26 times
!"#$%& ≤ min +
, -./0 1 + 3$%& , ,
,-./ 0/56
Prediction Error
Consistency Robustness
![Page 20: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/20.jpg)
OUTLINE• Mot iva t ion
• Sk i Renta l P rob lem
• The For tune Cook ie
• The Weatherman
• The Cons t ra ined Adversa ry
• Conc lus ions
![Page 21: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/21.jpg)
THE WEATHERMAN
• Predictions are backed by a probabilistic guarantee
• The algorithm can utilize these error probabilities to obtain better performance
![Page 22: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/22.jpg)
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?
![Page 23: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/23.jpg)
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, &)
![Page 24: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/24.jpg)
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
Com
petit
ive
ratio
![Page 25: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/25.jpg)
THE WEATHERMAN
h
Com
petit
ive ra
tio
competitive ratio= "(ℎ)" 1 = 1, " (
) = **+(
![Page 26: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/26.jpg)
OUTLINE• Mot iva t ion
• Sk i Renta l P rob lem
• The For tune Cook ie
• The Weatherman
• The Cons t ra ined Adversa ry
• Conc lus ions
![Page 27: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/27.jpg)
THE CONSTRAINED ADVERSARY
• Bound the amount of uncertainty
• Make structural assumptions about the online input
• More structure → Better guarantees
![Page 28: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/28.jpg)
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”
![Page 29: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/29.jpg)
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 + ∫GH1 + # !" # I# + ∫H
J@!" # I#
• Set probabilities so that KLMNO H
PQR(H,J)is a constant
![Page 30: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/30.jpg)
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 + ∫GH1 + # !" # 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
![Page 31: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/31.jpg)
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
![Page 32: THROUGH THE LENS OF SKI RENTAL THREE …vakilian/TTI-slides/purohit.pdfTHREE FLAVORS OF PREDICTIONS IN ONLINE ALGORITHMS THROUGH THE LENS OF SKI RENTAL Joint work with Ravi Kumar,](https://reader036.vdocuments.mx/reader036/viewer/2022081614/5fcccb0b854afd17856bf4ed/html5/thumbnails/32.jpg)
THANKS!