Skip to content

Commit 1079085

Browse files
ariapoyyangarbiter
andauthored
[MRG] Upgrade to support newest scikit-learn version (#188)
* Upgrade to sklearn==0.20. * Upgrade to sklearn==0.22. * Upgrade to sklearn==0.23. * Upgrade to sklearn==0.24. * Change the spacing style back to the original ver. * Pass CI with specific version range of sklearn. * Change the spacing style back to the original ver. * Change the spacing style back to the original ver. * Update libact/query_strategies/multiclass/mdsp.py Change the import style. Co-authored-by: yangarbiter <yangarbiter@users.noreply.github.com> Co-authored-by: yangarbiter <yangarbiter@users.noreply.github.com>
1 parent b5246a7 commit 1079085

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

libact/models/tests/test_svm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def setUp(self):
2929
def test_svm(self):
3030
svc_clf = SVC(gamma="auto")
3131
svc_clf.fit(self.X_train, self.y_train)
32-
svm = SVM()
32+
svm = SVM(gamma="auto")
3333
svm.train(Dataset(self.X_train, self.y_train))
3434

3535
assert_array_equal(

libact/query_strategies/multiclass/mdsp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
from sklearn.base import BaseEstimator
1717
from sklearn.metrics import euclidean_distances
1818
from sklearn.utils import check_random_state, check_array, check_symmetric
19-
from sklearn.externals.joblib import Parallel
20-
from sklearn.externals.joblib import delayed
19+
from joblib import Parallel, delayed
20+
2121
from sklearn.isotonic import IsotonicRegression
2222

2323

libact/query_strategies/multiclass/tests/test_hierarchical_sampling.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ def test_hs_random_selecting(self):
2929
qseq = run_qs(ds, qs, self.y, len(self.y)-10)
3030
assert_array_equal(
3131
np.concatenate([qseq[:10], qseq[-10:]]),
32-
np.array([48, 143, 13, 142, 88, 130, 29, 87, 36, 28,
33-
58, 137, 49, 105, 76, 71, 63, 47, 64, 55])
32+
np.array([39, 126, 66, 135, 37, 33, 118, 132, 142, 144,
33+
71, 28, 63, 41, 140, 34, 20, 110, 136, 36])
3434
)
3535

3636
def test_hs_active_selecting(self):
@@ -39,8 +39,8 @@ def test_hs_active_selecting(self):
3939
qseq = run_qs(ds, qs, self.y, len(self.y)-10)
4040
assert_array_equal(
4141
np.concatenate([qseq[:10], qseq[-10:]]),
42-
np.array([48, 143, 13, 64, 101, 108, 51, 87, 36, 28,
43-
43, 118, 47, 25, 81, 82, 95, 40, 67, 120])
42+
np.array([39, 126, 66, 135, 37, 33, 118, 132, 142, 144,
43+
89, 117, 48, 67, 75, 14, 79, 62, 105, 19])
4444
)
4545

4646
def test_hs_subsampling(self):
@@ -52,7 +52,7 @@ def test_hs_subsampling(self):
5252
assert_array_equal(
5353
np.concatenate([qseq[:10], qseq[-10:]]),
5454
np.array([120, 50, 33, 28, 78, 133, 52, 124, 102, 109,
55-
81, 108, 12, 10, 89, 114, 92, 126, 48, 25])
55+
81, 108, 10, 89, 126, 114, 92, 48, 25, 13])
5656
)
5757

5858
def test_hs_report_all_label(self):

libact/query_strategies/multilabel/tests/test_multilabel_realdata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_mmc(self):
4747
qs = MMC(trn_ds, random_state=1126)
4848
qseq = run_qs(trn_ds, qs, self.y, self.quota)
4949
assert_array_equal(qseq,
50-
np.array([117, 655, 1350, 909, 1003, 1116, 546, 1055, 165, 1441]))
50+
np.array([117, 655, 234, 1419, 1350, 1224, 427, 890, 1447, 103]))
5151

5252
def test_multilabel_with_auxiliary_learner_hlr(self):
5353
trn_ds = Dataset(self.X,

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
setuptools
22
numpy
33
scipy
4-
scikit-learn<=0.19.2
4+
scikit-learn>=0.24
55
matplotlib
66
Cython
77
joblib

0 commit comments

Comments
 (0)