mabwiser
mabwiser copied to clipboard
[Bug] Contextual models bug when using random_indices results in empty context
Line 242 of mabwiser.linear.py
arm_expectations[nonrandom_indices] = np.array([self.arm_to_model[arm].predict(nonrandom_context) for arm in arms]).T
if there is an epsilon > 0, and low numbers of context provided can result in nonrandom_indices being empty and therefore the predict method results in an error.
A simple fix would be to add "if len(nonrandom_context):" in the preceeding line.