def initialize_instances(infile):
    'Read the m_trg.csv CSV data into a list of instances.'
    instances = []
    dat = open(infile, 'r')
    reader = csv.reader(dat)
    dat.close()
    for row in reader:
        instance = Instance([float(value) for value in row[:(- 1)]])
        if (float(row[(- 1)]) < 0):
            instance.setLabel(Instance(0))
        else:
            instance.setLabel(Instance(1))
        instances.append(instance)
    return instances
Read the m_trg.csv CSV data into a list of instances.
def initialize_instances(infile):
    
    instances = []
    dat = open(infile, 'r')
    reader = csv.reader(dat)
    dat.close()
    for row in reader:
        instance = Instance([float(value) for value in row[:(- 1)]])
        if (float(row[(- 1)]) < 0):
            instance.setLabel(Instance(0))
        else:
            instance.setLabel(Instance(1))
        instances.append(instance)
    return instances