numpy==2.2.6
pandas==2.3.3
PyYAML==6.0.3
# Three packages, and for a bandit post that is not minimalism, it is the
# only honest option. Every bandit library hides exactly the thing this
# repository is about.
#
# `vowpalwabbit` gives you `--cb_explore_adf` and a tuned exploration
# constant you never see. `contextualbandits` gives you `BootstrappedUCB`
# with a percentile you never choose. Both are the right call in production
# and both would make `--sweep` impossible, and `--sweep` is the single most
# useful output here: the published exploration constants are 10 to 50 times
# too large at this horizon and arm count, and you can only discover that by
# having the constant in your hands.
#
# Everything below is optional and deliberately not installed.
#
# What it would replace: `np.linalg.solve` in `eval/ope.py::RewardModel.fit`
# and the Sherman-Morrison update in `policies/policies.py`. Neither needs
# replacing at 12 features. What flips at production scale is the feature
# count: LinUCB maintains a d-by-d inverse PER ARM, so at d = 2,000 features
# and 10,000 arms that is 10,000 matrices of 4 million floats, which is 160
# GB and not a rounding error. The production answer is a shared-parameter
# (hybrid) LinUCB where most of the coefficient vector is common across arms,
# which changes the model rather than the linear algebra, and that is the
# point at which this file's disjoint implementation stops being the right
# teaching example.
# scipy==1.15.3
#
# What it would replace: `eval/ope.py::RewardModel` is a per-arm ridge
# regression, which is `sklearn.linear_model.Ridge` in one line. Worth
# knowing what you lose: `RewardModel.coverage()` reports how many
# observations each arm's model was fitted on, which is the number that
# decides whether the direct-method estimate means anything, and no library
# surfaces it because no library knows the per-arm fit is the thing you need
# to be suspicious of. Measured: under the epsilon-greedy logger the worst
# arm has 36 observations for 12 coefficients, and the direct method is off
# by -25.0%.
# scikit-learn==1.6.1
#
# What it would replace: all of `policies/policies.py`, and in production it
# should. VW's contextual-bandit mode is the reference implementation, it
# handles the action-dependent-features case this file does not, and its
# importance-weighted regression approach scales to feature counts where the
# per-arm matrix inverse above stops fitting.
# vowpalwabbit==9.10.0
#
# What it would replace: `eval/ope.py` entirely, and this is the one
# recommendation here that is unreserved. Open Bandit Pipeline implements
# every estimator in that file plus switch-DR, DRos and the self-normalised
# variants, and crucially it implements the CONFIDENCE INTERVALS, which
# `eval/ope.py` does not and which are the part you actually need: the
# measured errors in the `--ope` table run from +4.8% to +96.0%, and an
# estimate at that spread without an interval around it is not a
# measurement. Written out here so the estimators' failure modes are
# visible; used from a library in anything real.
# obp==0.5.7
