comparison dataset.py @ 124:9c4f522526bf

Automated merge with ssh://p-omega1@lgcm.iro.umontreal.ca/tlearn
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Wed, 07 May 2008 16:20:40 -0400
parents 8b520423d4ee
children 7d8b3d6dd4e9
comparison
equal deleted inserted replaced
121:2ca8dccba270 124:9c4f522526bf
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