Skip to content

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

Merged
jerneju merged 3 commits intobiolab:masterfrom
janezd:fix-outliers
Oct 20, 2017
Merged

[FIX] Outliers widget no longer checks classes and doesn't crash on singular covariances matrices#2677
jerneju merged 3 commits intobiolab:masterfrom
janezd:fix-outliers

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
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