def runMultiplePass(df, model, nMultiplePass, nTrain):
  """
  run CLA model through data record 0:nTrain nMultiplePass passes
  """
  predictedField = model.getInferenceArgs()['predictedField']
  print "run TM through the train data multiple times"
  for nPass in xrange(nMultiplePass):
    for j in xrange(nTrain):
      inputRecord = getInputRecord(df, predictedField, j)
      result = model.run(inputRecord)
      if j % 100 == 0:
        print " pass %i, record %i" % (nPass, j)
    # reset temporal memory
    model._getTPRegion().getSelf()._tfdr.reset()

  return model
def runMultiplePass ( df , model , nMultiplePass , nTrain ) : predictedField = model . getInferenceArgs ( ) [ 'predictedField' ] print "run TM through the train data multiple times" for nPass in xrange ( nMultiplePass ) : for j in xrange ( nTrain ) : inputRecord = getInputRecord ( df , predictedField , j ) result = model . run ( inputRecord ) if j % 100 == 0 : print " pass %i, record %i" % ( nPass , j ) model . _getTPRegion ( ) . getSelf ( ) . _tfdr . reset ( ) return model
run CLA model through data record 0:nTrain nMultiplePass passes