Mercurial > pylearn
diff dataset.py @ 241:ddb88a8e9fd2
If I understand properly, the length of an unbounded stream is sys.maxint
author | delallea@opale.iro.umontreal.ca |
---|---|
date | Fri, 30 May 2008 10:14:46 -0400 |
parents | 38beb81f4e8b |
children | ef70a665aaaf |
line wrap: on
line diff
--- a/dataset.py Tue May 27 15:49:09 2008 -0400 +++ b/dataset.py Fri May 30 10:14:46 2008 -0400 @@ -47,14 +47,14 @@ columns/attributes are called fields. The field value for a particular example can be an arbitrary python object, which depends on the particular dataset. - We call a DataSet a 'stream' when its length is unbounded (otherwise its __len__ method + We call a DataSet a 'stream' when its length is unbounded (in which case its __len__ method should return sys.maxint). A DataSet is a generator of iterators; these iterators can run through the examples or the fields in a variety of ways. A DataSet need not necessarily have a finite or known length, so this class can be used to interface to a 'stream' which feeds on-line learning (however, as noted below, some operations are not - feasible or not recommanded on streams). + feasible or not recommended on streams). To iterate over examples, there are several possibilities: - for example in dataset: @@ -81,7 +81,7 @@ - for field_examples in dataset.fields(): for example_value in field_examples: ... - but when the dataset is a stream (unbounded length), it is not recommanded to do + but when the dataset is a stream (unbounded length), it is not recommended to do such things because the underlying dataset may refuse to access the different fields in an unsynchronized ways. Hence the fields() method is illegal for streams, by default. The result of fields() is a L{DataSetFields} object, which iterates over fields, @@ -599,7 +599,7 @@ * for field_examples in dataset.fields(): for example_value in field_examples: ... - but when the dataset is a stream (unbounded length), it is not recommanded to do + but when the dataset is a stream (unbounded length), it is not recommended to do such things because the underlying dataset may refuse to access the different fields in an unsynchronized ways. Hence the fields() method is illegal for streams, by default. The result of fields() is a DataSetFields object, which iterates over fields,