@@ -173,6 +173,28 @@ def __init__(self, name, description, format=None,
173173 else :
174174 self .data_pickle_file = None
175175
176+ def __str__ (self ):
177+ object_dict = self .__dict__
178+ output_str = ''
179+ name = '\n %14s: %s\n ' % ("Name" , object_dict ['name' ])
180+ version = '%14s: %s\n ' % ("Version" , object_dict ['version' ])
181+ format = '%14s: %s\n ' % ("Format" , object_dict ['format' ])
182+ date = '%14s: %s\n ' % ("Upload Date" , object_dict ['upload_date' ].replace ('T' , ' ' ))
183+ licence = '%14s: %s\n ' % ("Licence" , object_dict ['licence' ])
184+ d_url = '%14s: %s\n ' % ("Download URL" , object_dict ['url' ])
185+ base_url = 'https://www.openml.org/d/'
186+ w_url = '%14s: %s\n ' % ("OpenML URL" , base_url + str (self .dataset_id ))
187+ local_file = '%14s: %s\n ' % ("Data file" , object_dict ['data_file' ])
188+ pickle_file = '%14s: %s\n ' % ("Pickle file" , object_dict ['data_pickle_file' ])
189+ num_instances = ''
190+ if object_dict ['qualities' ]['NumberOfInstances' ] is not None :
191+ num_instances = '%14s: %d\n ' % ("# of instances" ,
192+ object_dict ['qualities' ]['NumberOfInstances' ])
193+ num_features = '%14s: %d\n ' % ("# of features" , len (object_dict ['features' ]))
194+ output_str = name + version + format + date + licence + d_url + w_url + local_file + \
195+ pickle_file + num_instances + num_features
196+ return (output_str )
197+
176198 def _data_arff_to_pickle (self , data_file ):
177199 data_pickle_file = data_file .replace ('.arff' , '.pkl.py3' )
178200 if os .path .exists (data_pickle_file ):
0 commit comments