comparison dataset.py @ 271:38e7d90a1218

code cleanup
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Tue, 03 Jun 2008 16:13:38 -0400
parents 1cafd495098c
children 6226ebafefc3
comparison
equal deleted inserted replaced
270:1cafd495098c 271:38e7d90a1218
1050 def __init__(self,dataset,fieldnames): 1050 def __init__(self,dataset,fieldnames):
1051 if fieldnames is None: fieldnames = dataset.fieldNames() 1051 if fieldnames is None: fieldnames = dataset.fieldNames()
1052 # store the resulting minibatch in a lookup-list of values 1052 # store the resulting minibatch in a lookup-list of values
1053 self.minibatch = LookupList(fieldnames,[0]*len(fieldnames)) 1053 self.minibatch = LookupList(fieldnames,[0]*len(fieldnames))
1054 self.dataset=dataset 1054 self.dataset=dataset
1055 assert 1<=len(dataset.data)
1056 self.current=0 1055 self.current=0
1057 self.columns = [self.dataset.fields_columns[f] 1056 self.columns = [self.dataset.fields_columns[f]
1058 for f in self.minibatch._names] 1057 for f in self.minibatch._names]
1059 self.l = self.dataset.data.shape[0] 1058 self.l = self.dataset.data.shape[0]
1060 def __iter__(self): 1059 def __iter__(self):