Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Commit e51fcd2

Browse files
committed
Closes #18.
1 parent 62be5be commit e51fcd2

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

biosppy/biometrics.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import numpy as np
2828
import shortuuid
2929
from bidict import bidict
30-
from sklearn import cross_validation as skcv
30+
from sklearn import model_selection as skcv
3131
from sklearn import svm as sksvm
3232

3333
# local
@@ -703,7 +703,7 @@ def cross_validation(cls, data, labels, cv, thresholds=None, **kwargs):
703703
labels : list, array
704704
A list of m class labels.
705705
cv : CV iterator
706-
A `sklearn.cross_validation` iterator.
706+
A `sklearn.model_selection` iterator.
707707
thresholds : array, optional
708708
Classifier thresholds to use.
709709
``**kwargs`` : dict, optional
@@ -2268,7 +2268,7 @@ def cross_validation(labels,
22682268
random_state=None):
22692269
"""Return a Cross Validation (CV) iterator.
22702270
2271-
Wraps the StratifiedShuffleSplit iterator from sklearn.cross_validation.
2271+
Wraps the StratifiedShuffleSplit iterator from sklearn.model_selection.
22722272
This iterator returns stratified randomized folds, which preserve the
22732273
percentage of samples for each class.
22742274
@@ -2295,10 +2295,11 @@ def cross_validation(labels,
22952295
22962296
"""
22972297

2298-
cv = skcv.StratifiedShuffleSplit(labels,
2299-
n_iter=n_iter,
2300-
test_size=test_size,
2301-
train_size=train_size,
2302-
random_state=random_state)
2298+
cv = skcv.StratifiedShuffleSplit(
2299+
n_splits=n_iter,
2300+
test_size=test_size,
2301+
train_size=train_size,
2302+
random_state=random_state,
2303+
).split(np.zeros(len(labels)), labels)
23032304

23042305
return utils.ReturnTuple((cv,), ('cv',))

biosppy/clustering.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import scipy.cluster.vq as scv
2323
import scipy.sparse as sp
2424
import sklearn.cluster as skc
25-
from sklearn.grid_search import ParameterGrid
25+
from sklearn.model_selection import ParameterGrid
2626

2727
# local
2828
from . import metrics, utils
@@ -247,7 +247,7 @@ def consensus(data=None, k=0, linkage='average', fcn=None, grid=None):
247247
A clustering function.
248248
grid : dict, list, optional
249249
A (list of) dictionary with parameters for each run of the clustering
250-
method (see sklearn.grid_search.ParameterGrid).
250+
method (see sklearn.model_selection.ParameterGrid).
251251
252252
Returns
253253
-------
@@ -352,7 +352,7 @@ def create_ensemble(data=None, fcn=None, grid=None):
352352
A clustering function.
353353
grid : dict, list, optional
354354
A (list of) dictionary with parameters for each run of the clustering
355-
method (see sklearn.grid_search.ParameterGrid).
355+
method (see sklearn.model_selection.ParameterGrid).
356356
357357
Returns
358358
-------

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ numpy==1.11.1
66
pyparsing==2.1.4
77
python-dateutil==2.5.3
88
pytz==2016.6.1
9-
scikit-learn==0.17.1
9+
scikit-learn==0.18.1
1010
scipy==0.18.1
1111
shortuuid==0.4.3
1212
six==1.10.0

0 commit comments

Comments
 (0)