david-cortes / contextualbandits

Python implementations of contextual bandits algorithms
http://contextual-bandits.readthedocs.io
BSD 2-Clause "Simplified" License
751 stars 148 forks source link

Fix a Numpy Warning Caused By an Empty Matrix #35

Closed YanjieHe closed 3 years ago

YanjieHe commented 3 years ago

When the w_node matrix is empty, numpy gives the following warning:

RuntimeWarning: invalid value encountered in double_scalars

Therefore, I added the check. If the matrix is empty, then we don't need to update w_node.

david-cortes commented 3 years ago

Thanks, merged.