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

version 1.1.2 update #33

Merged
merged 2 commits into from
Apr 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
MABWiser CHANGELOG
=====================

-------------------------------------------------------------------------------
April, 15, 2021 1.11.2
-------------------------------------------------------------------------------
minor:
- Updated dtype from np.int to int in base_mab.py line 294 to resolve deprecation warning from numpy>=1.20.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the specificity 😆

- Updated sklearn version dependency to >=0.24.0 because of changes in the KMeans implementation

-------------------------------------------------------------------------------
September, 14, 2020 1.11.1
-------------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ MABWiser is available to install as `pip install mabwiser`. It can also be insta

Please submit bug reports and feature requests as [Issues](https://github.com/fidelity/mabwiser/issues).


## Citation

If you use MABWiser in a publication, please cite it as:
Expand Down
2 changes: 1 addition & 1 deletion mabwiser/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

__author__ = "FMR LLC"
__email__ = "[email protected]"
__version__ = "1.11.1"
__version__ = "1.11.2"
__copyright__ = "Copyright (C), FMR LLC"
2 changes: 1 addition & 1 deletion mabwiser/base_mab.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def _partition_contexts(self, n_contexts: int):
n_jobs = self._effective_jobs(n_contexts, self.n_jobs)

# Partition contexts between jobs
n_contexts_per_job = np.full(n_jobs, n_contexts // n_jobs, dtype=np.int)
n_contexts_per_job = np.full(n_jobs, n_contexts // n_jobs, dtype=int)
n_contexts_per_job[:n_contexts % n_jobs] += 1
starts = np.cumsum(n_contexts_per_job)

Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
joblib
numpy
pandas
scikit-learn>=0.22.0
scikit-learn>=0.24.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not about this PR, but I am very curious how >= 0.24 will play with other libraries. It would be amazing if we can make a jump to the newer version, across the board.

scipy
seaborn>=0.9.0
seaborn>=0.9.0
6 changes: 3 additions & 3 deletions tests/test_clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_greedy0_n3(self):
num_run=1,
is_predict=True)

self.assertListEqual(arms, [2, 2])
self.assertListEqual(arms, [2, 3])
self.assertEqual(mab._imp.kmeans.n_clusters, 3)

def test_greedy1_n3(self):
Expand Down Expand Up @@ -231,7 +231,7 @@ def binarize(arm, reward):
is_predict=True)

self.assertTrue(mab._imp.lp_list[0].is_contextual_binarized)
self.assertListEqual(arms, [3, 4])
self.assertListEqual(arms, [3, 3])
self.assertEqual(len(mab._imp.decisions), 10)
self.assertEqual(len(mab._imp.rewards), 10)
self.assertEqual(len(mab._imp.contexts), 10)
Expand Down Expand Up @@ -271,7 +271,7 @@ def binarize(arm, reward):
is_predict=True)

self.assertTrue(mab._imp.lp_list[0].is_contextual_binarized)
self.assertListEqual(arms, [3, 4])
self.assertListEqual(arms, [3, 3])
self.assertEqual(len(mab._imp.decisions), 10)
self.assertEqual(len(mab._imp.rewards), 10)
self.assertEqual(len(mab._imp.contexts), 10)
Expand Down
14 changes: 7 additions & 7 deletions tests/test_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def test_UCB1_c2(self):
is_predict=True,
n_jobs=1)

self.assertEqual(arm, [[3, 3, 3, 1, 1, 1, 3, 1, 3, 3] for _ in range(5)])
self.assertEqual(arm, [[3, 3, 1, 1, 1, 1, 3, 1, 3, 3] for _ in range(5)])

arm, mab = self.predict(arms=[1, 2, 3, 4],
decisions=[1, 1, 1, 2, 2, 2, 3, 3, 3, 4],
Expand All @@ -250,7 +250,7 @@ def test_UCB1_c2(self):
is_predict=True,
n_jobs=2)

self.assertEqual(arm, [[3, 3, 3, 1, 1, 1, 3, 1, 3, 3] for _ in range(5)])
self.assertEqual(arm, [[3, 3, 1, 1, 1, 1, 3, 1, 3, 3] for _ in range(5)])

arm, mab = self.predict(arms=[1, 2, 3, 4],
decisions=[1, 1, 1, 2, 2, 2, 3, 3, 3, 4],
Expand All @@ -264,7 +264,7 @@ def test_UCB1_c2(self):
is_predict=True,
n_jobs=100)

self.assertEqual(arm, [[3, 3, 3, 1, 1, 1, 3, 1, 3, 3] for _ in range(5)])
self.assertEqual(arm, [[3, 3, 1, 1, 1, 1, 3, 1, 3, 3] for _ in range(5)])

def test_greedy1_k2(self):
rng = np.random.RandomState(seed=7)
Expand Down Expand Up @@ -576,7 +576,7 @@ def test_thompson_n3(self):
is_predict=True,
n_jobs=-1)

self.assertListEqual(arms, [1, 1, 3, 1, 1, 1, 1, 2, 1, 2])
self.assertListEqual(arms, [2, 1, 3, 3, 3, 2, 2, 3, 2, 3])

def test_thompson_a2(self):

Expand Down Expand Up @@ -879,7 +879,7 @@ def test_UCB1_c2_backend(self):
n_jobs=2,
backend=None)

self.assertEqual(arm, [[3, 3, 3, 1, 1, 1, 3, 1, 3, 3] for _ in range(5)])
self.assertEqual(arm, [[3, 3, 1, 1, 1, 1, 3, 1, 3, 3] for _ in range(5)])

arm, mab = self.predict(arms=[1, 2, 3, 4],
decisions=[1, 1, 1, 2, 2, 2, 3, 3, 3, 4],
Expand All @@ -894,7 +894,7 @@ def test_UCB1_c2_backend(self):
n_jobs=2,
backend='loky')

self.assertEqual(arm, [[3, 3, 3, 1, 1, 1, 3, 1, 3, 3] for _ in range(5)])
self.assertEqual(arm, [[3, 3, 1, 1, 1, 1, 3, 1, 3, 3] for _ in range(5)])

arm, mab = self.predict(arms=[1, 2, 3, 4],
decisions=[1, 1, 1, 2, 2, 2, 3, 3, 3, 4],
Expand All @@ -909,7 +909,7 @@ def test_UCB1_c2_backend(self):
n_jobs=2,
backend='threading')

self.assertEqual(arm, [[3, 3, 3, 1, 1, 1, 3, 1, 3, 3] for _ in range(5)])
self.assertEqual(arm, [[3, 3, 1, 1, 1, 1, 3, 1, 3, 3] for _ in range(5)])

def test_greedy1_k2_backend(self):
rng = np.random.RandomState(seed=7)
Expand Down