def train(oa, network, oaName, training_ints, validation_ints, testing_ints, measure):
    'Train a given network on a set of instances.\n    '
    print('\nError results for {}\n---------------------------'.format(oaName))
    times = [0]
    for iteration in xrange(TRAINING_ITERATIONS):
        start = time.clock()
        oa.train()
        elapsed = (time.clock() - start)
        times.append((times[(- 1)] + elapsed))
        if ((iteration % 10) == 0):
            (MSE_trg, acc_trg) = errorOnDataSet(network, training_ints, measure)
            (MSE_val, acc_val) = errorOnDataSet(network, validation_ints, measure)
            (MSE_tst, acc_tst) = errorOnDataSet(network, testing_ints, measure)
            txt = '{},{},{},{},{},{},{},{}\n'.format(iteration, MSE_trg, MSE_val, MSE_tst, acc_trg, acc_val, acc_tst, times[(- 1)])
            print(txt)
            f = open(OUTFILE, 'a+')
            f.write(txt)
            f.close()
Train a given network on a set of instances.
def train(oa, network, oaName, training_ints, validation_ints, testing_ints, measure):
    '\n    '
    print('\nError results for {}\n---------------------------'.format(oaName))
    times = [0]
    for iteration in xrange(TRAINING_ITERATIONS):
        start = time.clock()
        oa.train()
        elapsed = (time.clock() - start)
        times.append((times[(- 1)] + elapsed))
        if ((iteration % 10) == 0):
            (MSE_trg, acc_trg) = errorOnDataSet(network, training_ints, measure)
            (MSE_val, acc_val) = errorOnDataSet(network, validation_ints, measure)
            (MSE_tst, acc_tst) = errorOnDataSet(network, testing_ints, measure)
            txt = '{},{},{},{},{},{},{},{}\n'.format(iteration, MSE_trg, MSE_val, MSE_tst, acc_trg, acc_val, acc_tst, times[(- 1)])
            print(txt)
            f = open(OUTFILE, 'a+')
            f.write(txt)
            f.close()