Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Contextual models bug when using random_indices results in empty context #97

Open
tk-MF opened this issue Oct 25, 2024 · 0 comments

Comments

@tk-MF
Copy link

tk-MF commented Oct 25, 2024

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.

emanuele added a commit to emanuele/mabwiser that referenced this issue Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant