fidelity / mabwiser

[IJAIT 2021] MABWiser: Contextual Multi-Armed Bandits Library
https://fidelity.github.io/mabwiser/
Apache License 2.0
213 stars 42 forks source link

Vectorized Predict for Non-contextual Policies #53

Closed bkleyn closed 2 years ago

bkleyn commented 2 years ago
bkleyn commented 2 years ago

one quick question, how does specifying none contexts enables vectorization?

Predictions will only be vectorized when contexts is not none. In terms of usage it looks like this.

mab = MAB([1, 2, 3], LearningPolicy.Random()) mab.fit(decisions=[1, 1, 2, 2], rewards=[0, 1, 1, 1]) predictions = mab.predict([[], [], []]) # generate 3 predictions

The number of predictions returned is equal to the length of the context input.