@@ -70,25 +70,25 @@ def test_get_dataset(self):
7070
7171 def test_get_sparse_dataset (self ):
7272 rval = self .sparse_dataset .get_dataset ()
73- self .assertIsInstance (rval , scipy . sparse . spmatrix )
73+ self .assertIsInstance (rval , np . ndarray )
7474 self .assertEqual (rval .dtype , np .float32 )
7575 self .assertEqual ((2 , 20001 ), rval .shape )
7676 rval , categorical = self .sparse_dataset .get_dataset (
7777 return_categorical_indicator = True )
78- self .assertIsInstance (rval , scipy . sparse . spmatrix )
78+ self .assertIsInstance (rval , np . ndarray )
7979 self .assertEqual (len (categorical ), 20001 )
8080 self .assertTrue (all ([isinstance (cat , bool ) for cat in categorical ]))
8181 rval , attribute_names = self .sparse_dataset .get_dataset (
8282 return_attribute_names = True )
83- self .assertIsInstance (rval , scipy . sparse . spmatrix )
83+ self .assertIsInstance (rval , np . ndarray )
8484 self .assertEqual (len (attribute_names ), 20001 )
8585 self .assertTrue (all ([is_string (att ) for att in attribute_names ]))
8686
8787 def test_get_dataset_with_target (self ):
8888 X , y = self .dataset .get_dataset (target = "class" )
8989 self .assertIsInstance (X , np .ndarray )
9090 self .assertEqual (X .dtype , np .float32 )
91- self .assertEqual (y .dtype , np .int32 )
91+ self .assertEqual (y .dtype , np .int64 )
9292 self .assertEqual (X .shape , (898 , 38 ))
9393 X , y , attribute_names = self .dataset .get_dataset (
9494 target = "class" , return_attribute_names = True )
@@ -98,14 +98,14 @@ def test_get_dataset_with_target(self):
9898
9999 def test_get_sparse_dataset_with_target (self ):
100100 X , y = self .sparse_dataset .get_dataset (target = "class" )
101- self .assertIsInstance (X , scipy . sparse . spmatrix )
101+ self .assertIsInstance (X , np . ndarray )
102102 self .assertEqual (X .dtype , np .float32 )
103103 self .assertIsInstance (y , np .ndarray )
104- self .assertEqual (y .dtype , np .int32 )
104+ self .assertEqual (y .dtype , np .int64 )
105105 self .assertEqual (X .shape , (2 , 20000 ))
106106 X , y , attribute_names = self .sparse_dataset .get_dataset (
107107 target = "class" , return_attribute_names = True )
108- self .assertIsInstance (X , scipy . sparse . spmatrix )
108+ self .assertIsInstance (X , np . ndarray )
109109 self .assertEqual (len (attribute_names ), 20000 )
110110 self .assertNotIn ("class" , attribute_names )
111111 self .assertEqual (y .shape , (2 , ))
@@ -132,13 +132,13 @@ def test_get_sparse_dataset_with_rowid(self):
132132 self .sparse_dataset .row_id_attribute = "a_0"
133133 rval , categorical = self .sparse_dataset .get_dataset (
134134 include_row_id = True , return_categorical_indicator = True )
135- self .assertIsInstance (rval , scipy . sparse . spmatrix )
135+ self .assertIsInstance (rval , np . ndarray )
136136 self .assertEqual (rval .dtype , np .float32 )
137137 self .assertEqual (rval .shape , (2 , 20001 ))
138138 self .assertEqual (len (categorical ), 20001 )
139139 rval , categorical = self .sparse_dataset .get_dataset (
140140 include_row_id = False , return_categorical_indicator = True )
141- self .assertIsInstance (rval , scipy . sparse . spmatrix )
141+ self .assertIsInstance (rval , np . ndarray )
142142 self .assertEqual (rval .dtype , np .float32 )
143143 self .assertEqual (rval .shape , (2 , 20000 ))
144144 self .assertEqual (len (categorical ), 20000 )
@@ -167,20 +167,20 @@ def test_get_dataset_with_ignore_attributes(self):
167167 def test_get_sparse_dataset_with_ignore_attributes (self ):
168168 self .sparse_dataset .ignore_attributes = "a_0"
169169 rval = self .sparse_dataset .get_dataset (include_ignore_attributes = True )
170- self .assertIsInstance (rval , scipy . sparse . spmatrix )
170+ self .assertIsInstance (rval , np . ndarray )
171171 self .assertEqual (rval .dtype , np .float32 )
172172 self .assertEqual (rval .shape , (2 , 20001 ))
173173 rval , categorical = self .sparse_dataset .get_dataset (
174174 include_ignore_attributes = True , return_categorical_indicator = True )
175- self .assertIsInstance (rval , scipy . sparse . spmatrix )
175+ self .assertIsInstance (rval , np . ndarray )
176176 self .assertEqual (len (categorical ), 20001 )
177177 rval = self .sparse_dataset .get_dataset (include_ignore_attributes = False )
178- self .assertIsInstance (rval , scipy . sparse . spmatrix )
178+ self .assertIsInstance (rval , np . ndarray )
179179 self .assertEqual (rval .dtype , np .float32 )
180180 self .assertEqual (rval .shape , (2 , 20000 ))
181181 rval , categorical = self .sparse_dataset .get_dataset (
182182 include_ignore_attributes = False , return_categorical_indicator = True )
183- self .assertIsInstance (rval , scipy . sparse . spmatrix )
183+ self .assertIsInstance (rval , np . ndarray )
184184 self .assertEqual (len (categorical ), 20000 )
185185 # TODO test multiple ignore attributes!
186186
@@ -190,7 +190,7 @@ def test_get_dataset_rowid_and_ignore_and_target(self):
190190 X , y = self .dataset .get_dataset (target = "class" , include_row_id = False ,
191191 include_ignore_attributes = False )
192192 self .assertEqual (X .dtype , np .float32 )
193- self .assertEqual (y .dtype , np .int32 )
193+ self .assertEqual (y .dtype , np .int64 )
194194 self .assertEqual (X .shape , (898 , 36 ))
195195 X , y , categorical = self .dataset .get_dataset (
196196 target = "class" , return_categorical_indicator = True )
@@ -204,13 +204,13 @@ def test_get_sparse_dataset_rowid_and_ignore_and_target(self):
204204 self .sparse_dataset .row_id_attribute = "a_1"
205205 X , y = self .sparse_dataset .get_dataset (target = "class" ,
206206 include_row_id = False , include_ignore_attributes = False )
207- self .assertIsInstance (X , scipy . sparse . spmatrix )
207+ self .assertIsInstance (X , np . ndarray )
208208 self .assertEqual (X .dtype , np .float32 )
209- self .assertEqual (y .dtype , np .int32 )
209+ self .assertEqual (y .dtype , np .int64 )
210210 self .assertEqual (X .shape , (2 , 19998 ))
211211 X , y , categorical = self .sparse_dataset .get_dataset (
212212 target = "class" , return_categorical_indicator = True )
213- self .assertIsInstance (X , scipy . sparse . spmatrix )
213+ self .assertIsInstance (X , np . ndarray )
214214 self .assertEqual (len (categorical ), 19998 )
215215 self .assertListEqual (categorical , [False ] * 19998 )
216216 self .assertEqual (y .shape , (2 , ))
0 commit comments