def make_vw(data, targets, filename):
    """
    Helper method to create a vowpal wabbit dataset from data and targets and
    save it to filename
    """
    s = []
    for yi, xi in zip(targets, data):
        xis = ' '.join(['f%i:%f' % (f, xi[0,f]) for f in xi.nonzero()[1]])
        s.append('%f | %s' %(yi, xis))
    f = open(filename, 'w')
    f.write('\n'.join(s))
    f.close()
dataset/ETHPy150Open theusual/kaggle-seeclickfix-ensemble/Miroslaw/utils.py/make_vw/original