comparison dataset.py @ 123:8b520423d4ee

bugfix
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Wed, 07 May 2008 16:17:25 -0400
parents 8fa1ef2411a0
children 7d8b3d6dd4e9
comparison
equal deleted inserted replaced
122:d3c72e412065 123:8b520423d4ee
353 len(dataset) returns the number of examples in the dataset. 353 len(dataset) returns the number of examples in the dataset.
354 By default, a DataSet is a 'stream', i.e. it has an unbounded length (sys.maxint). 354 By default, a DataSet is a 'stream', i.e. it has an unbounded length (sys.maxint).
355 Sub-classes which implement finite-length datasets should redefine this method. 355 Sub-classes which implement finite-length datasets should redefine this method.
356 Some methods only make sense for finite-length datasets. 356 Some methods only make sense for finite-length datasets.
357 """ 357 """
358 return sys.maxint 358 return maxint
359 359
360 def is_unbounded(self): 360 def is_unbounded(self):
361 """ 361 """
362 Tests whether a dataset is unbounded (e.g. a stream). 362 Tests whether a dataset is unbounded (e.g. a stream).
363 """ 363 """
364 return len(self)==sys.maxint 364 return len(self)==maxint
365 365
366 def hasFields(self,*fieldnames): 366 def hasFields(self,*fieldnames):
367 """ 367 """
368 Return true if the given field name (or field names, if multiple arguments are 368 Return true if the given field name (or field names, if multiple arguments are
369 given) is recognized by the DataSet (i.e. can be used as a field name in one 369 given) is recognized by the DataSet (i.e. can be used as a field name in one