def _generateCategory(filename='simple.csv', numSequences=2, elementsPerSeq=1, numRepeats=10):
 scriptDir = os.path.dirname(__file__)
 pathname = os.path.join(scriptDir, 'datasets', filename)
 print ('Creating %s...' % pathname)
 fields = [('classification', 'string', ''), ('field1', 'string', '')]
 outFile = FileRecordStream(pathname, write=True, fields=fields)
 sequences = []
 for i in range(numSequences):
  seq = [x for x in range((i * elementsPerSeq), ((i + 1) * elementsPerSeq))]
  sequences.append(seq)
 seqIdxs = []
 for i in range(numRepeats):
  seqIdxs += range(numSequences)
 random.shuffle(seqIdxs)
 for seqIdx in seqIdxs:
  seq = sequences[seqIdx]
  for x in seq:
   outFile.appendRecord([str(seqIdx), str(x)])
 outFile.close()

def _generateCategory ( filename = 'simple.csv' , numSequences = 2 , elementsPerSeq = 1 , numRepeats = 10 ) : scriptDir = os . path . dirname ( __file__ ) pathname = os . path . join ( scriptDir , 'datasets' , filename ) print ( 'Creating %s...' % pathname ) fields = [ ( 'classification' , 'string' , '' ) , ( 'field1' , 'string' , '' ) ] outFile = FileRecordStream ( pathname , write = True , fields = fields ) sequences = [ ] for i in range ( numSequences ) : seq = [ x for x in range ( ( i * elementsPerSeq ) , ( ( i + 1 ) * elementsPerSeq ) ) ] sequences . append ( seq ) seqIdxs = [ ] for i in range ( numRepeats ) : seqIdxs += range ( numSequences ) random . shuffle ( seqIdxs ) for seqIdx in seqIdxs : seq = sequences [ seqIdx ] for x in seq : outFile . appendRecord ( [ str ( seqIdx ) , str ( x ) ] ) outFile . close ( )
generate a simple dataset .