@@ -2393,10 +2393,10 @@ def test_transpose_continuous_class(self):
23932393
23942394 att = [ContinuousVariable ("Feature 1" ), ContinuousVariable ("Feature 2" ),
23952395 ContinuousVariable ("Feature 3" ), ContinuousVariable ("Feature 4" )]
2396- att [0 ].attributes = {"cls" : "4.000 " }
2397- att [1 ].attributes = {"cls" : "3.000 " }
2398- att [2 ].attributes = {"cls" : "2.000 " }
2399- att [3 ].attributes = {"cls" : "1.000 " }
2396+ att [0 ].attributes = {"cls" : "4" }
2397+ att [1 ].attributes = {"cls" : "3" }
2398+ att [2 ].attributes = {"cls" : "2" }
2399+ att [3 ].attributes = {"cls" : "1" }
24002400 domain = Domain (att , metas = [StringVariable ("Feature name" )])
24012401 result = Table (domain , np .arange (8 ).reshape ((4 , 2 )).T ,
24022402 metas = np .array (["c1" , "c2" ])[:, None ])
@@ -2419,9 +2419,9 @@ def test_transpose_missing_class(self):
24192419
24202420 att = [ContinuousVariable ("Feature 1" ), ContinuousVariable ("Feature 2" ),
24212421 ContinuousVariable ("Feature 3" ), ContinuousVariable ("Feature 4" )]
2422- att [1 ].attributes = {"cls" : "3.000 " }
2423- att [2 ].attributes = {"cls" : "2.000 " }
2424- att [3 ].attributes = {"cls" : "1.000 " }
2422+ att [1 ].attributes = {"cls" : "3" }
2423+ att [2 ].attributes = {"cls" : "2" }
2424+ att [3 ].attributes = {"cls" : "1" }
24252425 domain = Domain (att , metas = [StringVariable ("Feature name" )])
24262426 result = Table (domain , np .arange (8 ).reshape ((4 , 2 )).T ,
24272427 metas = np .array (["c1" , "c2" ])[:, None ])
@@ -2445,10 +2445,10 @@ def test_transpose_multiple_class(self):
24452445
24462446 att = [ContinuousVariable ("Feature 1" ), ContinuousVariable ("Feature 2" ),
24472447 ContinuousVariable ("Feature 3" ), ContinuousVariable ("Feature 4" )]
2448- att [0 ].attributes = {"cls1" : "0.000 " , "cls2" : "1.000 " }
2449- att [1 ].attributes = {"cls1" : "2.000 " , "cls2" : "3.000 " }
2450- att [2 ].attributes = {"cls1" : "4.000 " , "cls2" : "5.000 " }
2451- att [3 ].attributes = {"cls1" : "6.000 " , "cls2" : "7.000 " }
2448+ att [0 ].attributes = {"cls1" : "0" , "cls2" : "1" }
2449+ att [1 ].attributes = {"cls1" : "2" , "cls2" : "3" }
2450+ att [2 ].attributes = {"cls1" : "4" , "cls2" : "5" }
2451+ att [3 ].attributes = {"cls1" : "6" , "cls2" : "7" }
24522452 domain = Domain (att , metas = [StringVariable ("Feature name" )])
24532453 result = Table (domain , np .arange (8 ).reshape ((4 , 2 )).T ,
24542454 metas = np .array (["c1" , "c2" ])[:, None ])
@@ -2529,10 +2529,10 @@ def test_transpose_continuous_metas(self):
25292529
25302530 att = [ContinuousVariable ("Feature 1" ), ContinuousVariable ("Feature 2" ),
25312531 ContinuousVariable ("Feature 3" ), ContinuousVariable ("Feature 4" )]
2532- att [0 ].attributes = {"m1" : "0.000 " }
2533- att [1 ].attributes = {"m1" : "1.000 " }
2534- att [2 ].attributes = {"m1" : "0.000 " }
2535- att [3 ].attributes = {"m1" : "1.000 " }
2532+ att [0 ].attributes = {"m1" : "0" }
2533+ att [1 ].attributes = {"m1" : "1" }
2534+ att [2 ].attributes = {"m1" : "0" }
2535+ att [3 ].attributes = {"m1" : "1" }
25362536 domain = Domain (att , metas = [StringVariable ("Feature name" )])
25372537 result = Table (domain , np .arange (8 ).reshape ((4 , 2 )).T ,
25382538 metas = np .array (["c1" , "c2" ])[:, None ])
@@ -2613,10 +2613,10 @@ def test_transpose_class_and_metas(self):
26132613
26142614 att = [ContinuousVariable ("Feature 1" ), ContinuousVariable ("Feature 2" ),
26152615 ContinuousVariable ("Feature 3" ), ContinuousVariable ("Feature 4" )]
2616- att [0 ].attributes = {"cls" : "1.000 " , "m1" : "aa" , "m2" : "aaa" }
2617- att [1 ].attributes = {"cls" : "2.000 " , "m1" : "bb" , "m2" : "bbb" }
2618- att [2 ].attributes = {"cls" : "3.000 " , "m1" : "cc" , "m2" : "ccc" }
2619- att [3 ].attributes = {"cls" : "4.000 " , "m1" : "dd" , "m2" : "ddd" }
2616+ att [0 ].attributes = {"cls" : "1" , "m1" : "aa" , "m2" : "aaa" }
2617+ att [1 ].attributes = {"cls" : "2" , "m1" : "bb" , "m2" : "bbb" }
2618+ att [2 ].attributes = {"cls" : "3" , "m1" : "cc" , "m2" : "ccc" }
2619+ att [3 ].attributes = {"cls" : "4" , "m1" : "dd" , "m2" : "ddd" }
26202620 domain = Domain (att , metas = [StringVariable ("Feature name" )])
26212621 result = Table (domain , np .arange (8 ).reshape ((4 , 2 )).T ,
26222622 metas = np .array (["c1" , "c2" ])[:, None ])
@@ -2660,8 +2660,8 @@ def test_transpose_attributes_of_attributes_discrete(self):
26602660
26612661 def test_transpose_attributes_of_attributes_continuous (self ):
26622662 attrs = [ContinuousVariable ("c1" ), ContinuousVariable ("c2" )]
2663- attrs [0 ].attributes = {"attr1" : "1.100 " , "attr2" : "1.300 " }
2664- attrs [1 ].attributes = {"attr1" : "2.200 " , "attr2" : "2.300 " }
2663+ attrs [0 ].attributes = {"attr1" : "1.1 " , "attr2" : "1.3 " }
2664+ attrs [1 ].attributes = {"attr1" : "2.2 " , "attr2" : "2.3 " }
26652665 domain = Domain (attrs )
26662666 data = Table (domain , np .arange (8 ).reshape ((4 , 2 )))
26672667
@@ -2683,7 +2683,7 @@ def test_transpose_attributes_of_attributes_continuous(self):
26832683
26842684 # original should not change
26852685 self .assertDictEqual (data .domain .attributes [0 ].attributes ,
2686- {"attr1" : "1.100 " , "attr2" : "1.300 " })
2686+ {"attr1" : "1.1 " , "attr2" : "1.3 " })
26872687
26882688 def test_transpose_attributes_of_attributes_missings (self ):
26892689 attrs = [ContinuousVariable ("c1" ), ContinuousVariable ("c2" )]
@@ -2724,10 +2724,10 @@ def test_transpose_class_metas_attributes(self):
27242724
27252725 att = [ContinuousVariable ("Feature 1" ), ContinuousVariable ("Feature 2" ),
27262726 ContinuousVariable ("Feature 3" ), ContinuousVariable ("Feature 4" )]
2727- att [0 ].attributes = {"cls" : "1.000 " , "m1" : "aa" , "m2" : "aaa" }
2728- att [1 ].attributes = {"cls" : "2.000 " , "m1" : "bb" , "m2" : "bbb" }
2729- att [2 ].attributes = {"cls" : "3.000 " , "m1" : "cc" , "m2" : "ccc" }
2730- att [3 ].attributes = {"cls" : "4.000 " , "m1" : "dd" , "m2" : "ddd" }
2727+ att [0 ].attributes = {"cls" : "1" , "m1" : "aa" , "m2" : "aaa" }
2728+ att [1 ].attributes = {"cls" : "2" , "m1" : "bb" , "m2" : "bbb" }
2729+ att [2 ].attributes = {"cls" : "3" , "m1" : "cc" , "m2" : "ccc" }
2730+ att [3 ].attributes = {"cls" : "4" , "m1" : "dd" , "m2" : "ddd" }
27312731 metas = [StringVariable ("Feature name" ),
27322732 DiscreteVariable ("attr1" , values = ("a1" , "b1" )),
27332733 DiscreteVariable ("attr2" , values = ("aa1" , "bb1" ))]
0 commit comments