Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Outliers widget no longer checks classes and doesn't crash on singular covariances matrices #2677

Merged
merged 3 commits into from
Oct 20, 2017

Conversation

janezd
Copy link
Contributor

@janezd janezd commented Oct 13, 2017

Issue
  • Outliers widget does not work with multiple classes.
  • ... and crashes when variance matrices is singular, instead of reporting an error.
  • EllipticEnvelopeLearner removes instances without classes.

Fixes #2588.

Description of changes
  • Remove tests for classes
  • Fix the crash for singular data
  • Set proper preprocessors for EllipticEnvelopeLearner

Tests do not add much new; they passed before, too. The PR actually removes tests that checked for what shouldn't had been checked.

Includes
  • Code changes
  • Tests

@codecov-io
Copy link

Codecov Report

Merging #2677 into master will decrease coverage by <.01%.
The diff coverage is 92.85%.

@@            Coverage Diff             @@
##           master    #2677      +/-   ##
==========================================
- Coverage   75.65%   75.65%   -0.01%     
==========================================
  Files         333      333              
  Lines       58422    58418       -4     
==========================================
- Hits        44202    44197       -5     
- Misses      14220    14221       +1

@janezd janezd changed the title [FIX] Outliers widget does not ignore classes and crashes on singular covariances matrices [FIX] Outliers widget no longer checks classes and crashes on singular covariances matrices Oct 16, 2017
@janezd janezd changed the title [FIX] Outliers widget no longer checks classes and crashes on singular covariances matrices [FIX] Outliers widget no longer checks classes and doesn't crash on singular covariances matrices Oct 16, 2017
@janezd janezd added this to the 3.7 milestone Oct 17, 2017
@@ -27,6 +28,7 @@ def mahalanobis(self, observations):
class EllipticEnvelopeLearner(SklLearner):
__wraps__ = skl_covariance.EllipticEnvelope
__returns__ = EllipticEnvelopeClassifier
preprocessors = [Continuize(), RemoveNaNColumns(), SklImpute()]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are these preprocessors used?

Copy link
Contributor

@kernc kernc Oct 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

orange3/Orange/base.py

Lines 132 to 143 in 8ee65c0

def preprocess(self, data):
"""Apply the `preprocessors` to the data"""
for pp in self.active_preprocessors:
data = pp(data)
return data
@property
def active_preprocessors(self):
yield from self.preprocessors
if (self.use_default_preprocessors and
self.preprocessors is not type(self).preprocessors):
yield from type(self).preprocessors

@jerneju jerneju merged commit aabd844 into biolab:master Oct 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants