Skip to content

Commit

Permalink
Correlations: Compute correlations with cont class var by default
Browse files Browse the repository at this point in the history
  • Loading branch information
VesnaT committed Oct 2, 2019
1 parent 3a0eb16 commit afe68a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Orange/widgets/data/owcorrelations.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,11 @@ def set_data(self, data):

def set_feature_model(self):
self.feature_model.set_domain(self.cont_data and self.cont_data.domain)
self.feature = None
data = self.data
if self.cont_data and data.domain.has_continuous_class:
self.feature = self.cont_data.domain[data.domain.class_var.name]
else:
self.feature = None

def apply(self):
self.vizrank.initialize()
Expand Down
7 changes: 6 additions & 1 deletion Orange/widgets/data/tests/test_owcorrelations.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,13 @@ def test_input_data_cont_target(self):
self.send_signal(self.widget.Inputs.data, data)
time.sleep(0.1)
self.process_events()
self.assertEqual(self.widget.vizrank.rank_model.rowCount(), 3)
self.assertEqual(self.widget.vizrank.rank_model.rowCount(), 2)
self.assertEqual(self.widget.controls.feature.count(), 4)
self.assertEqual(self.widget.controls.feature.currentText(), "MEDV")

data = self.housing[:5, 13:]
self.send_signal(self.widget.Inputs.data, data)
self.assertTrue(self.widget.Warning.not_enough_vars.is_shown())

def test_output_data(self):
"""Check dataset on output"""
Expand Down

0 comments on commit afe68a0

Please sign in to comment.