Skip to content

Commit c286957

Browse files
committed
preprocess: Fix RemoveNaNClasses / Use existing HasClass
1 parent 48e820b commit c286957

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Orange/preprocess/preprocess.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import bottleneck as bn
1010

1111
import Orange.data
12+
from Orange.data.filter import HasClass
1213
from Orange.preprocess.util import _RefuseDataInConstructor
1314
from Orange.statistics import distribution
1415
from Orange.util import Reprable, Enum
@@ -216,11 +217,7 @@ def __call__(self, data):
216217
-------
217218
data : data set without rows with missing classes
218219
"""
219-
if len(data.Y.shape) > 1:
220-
nan_cls = np.any(np.isnan(data.Y), axis=1)
221-
else:
222-
nan_cls = np.isnan(data.Y)
223-
return data[~nan_cls]
220+
return HasClass()(data)
224221

225222

226223
class Normalize(Preprocess):

0 commit comments

Comments
 (0)