Skip to content

Commit aa5fcef

Browse files
committed
EllipticEnvelopeClassifier: Don't check for classes
1 parent 102916c commit aa5fcef

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Orange/classification/elliptic_envelope.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from Orange.base import SklLearner, SklModel
44
from Orange.data import Table
5+
from Orange.preprocess import Continuize, RemoveNaNColumns, SklImpute
56

67
__all__ = ["EllipticEnvelopeLearner"]
78

@@ -27,6 +28,7 @@ def mahalanobis(self, observations):
2728
class EllipticEnvelopeLearner(SklLearner):
2829
__wraps__ = skl_covariance.EllipticEnvelope
2930
__returns__ = EllipticEnvelopeClassifier
31+
preprocessors = [Continuize(), RemoveNaNColumns(), SklImpute()]
3032

3133
def __init__(self, store_precision=True, assume_centered=False,
3234
support_fraction=None, contamination=0.1,

Orange/widgets/data/tests/test_owoutliers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,11 @@ def test_memory_error(self):
3737
side_effect=MemoryError):
3838
self.send_signal("Data", data)
3939
self.assertTrue(self.widget.Error.memory_error.is_shown())
40+
41+
def test_nans(self):
42+
"""Widget does not crash with nans"""
43+
a = np.arange(20, dtype=float).reshape(4, 5)
44+
a[0, 0] = np.nan
45+
data = Table(a)
46+
self.send_signal(self.widget.Inputs.data, data)
47+
self.assertIsNot(self.get_output(self.widget.Outputs.inliers), None)

0 commit comments

Comments
 (0)