@@ -28,6 +28,7 @@ def setUpClass(cls):
28
28
cls .data_cont = Table ("iris" )
29
29
cls .data_disc = Table ("zoo" )
30
30
cls .data_mixed = Table ("heart_disease" )
31
+ cls .housing = Table ("housing" )
31
32
32
33
def setUp (self ):
33
34
self .widget = self .create_widget (OWCorrelations )
@@ -86,7 +87,7 @@ def test_input_data_one_instance(self):
86
87
self .assertFalse (self .widget .Warning .not_enough_inst .is_shown ())
87
88
88
89
def test_input_data_with_constant_features (self ):
89
- """Check correlation table for dataset with a constant columns"""
90
+ """Check correlation table for dataset with constant columns"""
90
91
np .random .seed (0 )
91
92
# pylint: disable=no-member
92
93
X = np .random .randint (3 , size = (4 , 3 )).astype (float )
@@ -118,6 +119,20 @@ def test_input_data_with_constant_features(self):
118
119
self .send_signal (self .widget .Inputs .data , None )
119
120
self .assertFalse (self .widget .Information .removed_cons_feat .is_shown ())
120
121
122
+ def test_input_data_cont_target (self ):
123
+ """Check correlation table for dataset with continuous class variable"""
124
+ data = self .housing [:5 , 11 :]
125
+ self .send_signal (self .widget .Inputs .data , data )
126
+ time .sleep (0.1 )
127
+ self .process_events ()
128
+ self .assertEqual (self .widget .vizrank .rank_model .rowCount (), 2 )
129
+ self .assertEqual (self .widget .controls .feature .count (), 4 )
130
+ self .assertEqual (self .widget .controls .feature .currentText (), "MEDV" )
131
+
132
+ data = self .housing [:5 , 13 :]
133
+ self .send_signal (self .widget .Inputs .data , data )
134
+ self .assertTrue (self .widget .Warning .not_enough_vars .is_shown ())
135
+
121
136
def test_output_data (self ):
122
137
"""Check dataset on output"""
123
138
self .send_signal (self .widget .Inputs .data , self .data_cont )
@@ -230,8 +245,8 @@ def test_feature_combo(self):
230
245
self .assertEqual (len (feature_combo .model ()), len (cont_attributes ) + 1 )
231
246
232
247
self .wait_until_stop_blocking ()
233
- self .send_signal (self .widget .Inputs .data , Table ( " housing" ) )
234
- self .assertEqual (len (feature_combo .model ()), 14 )
248
+ self .send_signal (self .widget .Inputs .data , self . housing )
249
+ self .assertEqual (len (feature_combo .model ()), 15 )
235
250
236
251
def test_select_feature (self ):
237
252
"""Test feature selection"""
0 commit comments