Skip to content

Commit

Permalink
MABWiser update (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleyn authored Feb 23, 2023
1 parent c2a3f62 commit b5b175d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ on:

jobs:
Test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ['3.7', '3.8', '3.9', '3.10']
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
CHANGELOG
=========

-------------------------------------------------------------------------------
February, 23, 2023 1.1.0
-------------------------------------------------------------------------------

Major:
- Updated requirements to use mabwiser>=2.7 to benefit from enhancements,
including vectorized predict for Linear policies and tracking of arm status.
- Fixed tests due to changes in random seeding for Linear policies.

-------------------------------------------------------------------------------
August, 16, 2022 1.0.3
-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ scikit-learn>=0.24.0
scipy
matplotlib
seaborn>=0.1.0
mabwiser>=2.4.0
mabwiser>=2.7.0
jurity>=1.3.2
spock-config>=2.1.4
14 changes: 7 additions & 7 deletions tests/test_rec.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,13 +611,13 @@ def test_recommend_lin_greedy(self):
[0, 2, 1, 0, 0]],
top_k=2,
seed=123456)
self.assertEqual(results[0], [[3, 1], [1, 3]])
self.assertEqual(results[0], [[3, 1], [2, 3]])
self.assertListAlmostEqual(results[1][0], [0.6504125435586658, 0.5240639631785098])
self.assertListAlmostEqual(results[1][1], [0.7114885562660387, 0.5354020923417662])
self.assertListAlmostEqual(results[1][1], [0.7221703184615302, 0.7121913829791641])

# No scores
results = rec.recommend([[0, 1, 2, 3, 5], [1, 1, 1, 1, 1]], return_scores=False)
self.assertEqual(results, [[3, 1], [2, 3]])
self.assertEqual(results, [[2, 3], [2, 1]])

def test_recommend_lin_ucb(self):
results, rec = self.predict(arms=[1, 2, 3],
Expand Down Expand Up @@ -653,13 +653,13 @@ def test_recommend_lin_ts(self):
[0, 2, 1, 0, 0]],
top_k=2,
seed=123456)
self.assertEqual(results[0], [[2, 3], [3, 1]])
self.assertListAlmostEqual(results[1][0], [0.9571299309237765, 0.7351400505873965])
self.assertListAlmostEqual(results[1][1], [0.8548770839301622, 0.7726819822665895])
self.assertEqual(results[0], [[3, 2], [1, 3]])
self.assertListAlmostEqual(results[1][0], [0.6393327956234724, 0.6113795857188596])
self.assertListAlmostEqual(results[1][1], [0.9231640190086698, 0.9093145340785204])

# No scores
results = rec.recommend([[0, 1, 2, 3, 5], [1, 1, 1, 1, 1]], return_scores=False)
self.assertEqual(results, [[2, 3], [1, 3]])
self.assertEqual(results, [[3, 1], [1, 3]])

def test_recommend_clusters_ts(self):
results, rec = self.predict(arms=[1, 2, 3],
Expand Down

0 comments on commit b5b175d

Please sign in to comment.