File tree Expand file tree Collapse file tree 3 files changed +3
-9
lines changed Expand file tree Collapse file tree 3 files changed +3
-9
lines changed Original file line number Diff line number Diff line change 1
1
"""Implement generators for ``keras`` which will balance the data."""
2
2
from __future__ import division
3
3
4
- import pytest
4
+ import keras
5
5
6
6
from scipy .sparse import issparse
7
7
10
10
from sklearn .utils import check_random_state
11
11
from sklearn .utils .testing import set_random_state
12
12
13
- keras = pytest .importorskip ("keras" )
14
-
15
13
from ..under_sampling import RandomUnderSampler
16
14
from ..utils import Substitution
17
15
from ..utils ._docstring import _random_state_docstring
@@ -141,7 +139,7 @@ def __getitem__(self, index):
141
139
self .indices_ [index * self .batch_size :
142
140
(index + 1 ) * self .batch_size ])
143
141
if issparse (sample_weight_resampled ) and not self .sparse :
144
- sample_weight = sample_weight .toarray ()
142
+ sample_weight_resampled = sample_weight_resampled .toarray ()
145
143
146
144
if self .sample_weight is None :
147
145
return X_resampled , y_resampled
Original file line number Diff line number Diff line change 2
2
3
3
from __future__ import division
4
4
5
- import pytest
6
-
7
5
from scipy .sparse import issparse
8
6
9
7
from sklearn .base import clone
10
8
from sklearn .utils import safe_indexing
11
9
from sklearn .utils import check_random_state
12
10
from sklearn .utils .testing import set_random_state
13
11
14
- tf = pytest .importorskip ("tensorflow" )
15
-
16
12
from ..under_sampling import RandomUnderSampler
17
13
from ..utils import Substitution
18
14
from ..utils ._docstring import _random_state_docstring
Original file line number Diff line number Diff line change @@ -35,4 +35,4 @@ doctest-fixtures = _fixture
35
35
[tool:pytest]
36
36
addopts =
37
37
--doctest-modules
38
-
38
+ --doctest-ignore-import-errors
You can’t perform that action at this time.
0 commit comments