コード例 #1
0
def run(gap):
    data = helper.loadShopPay()
    start_date = util.getLabelStartDate(data)

    fout = open(helper.get_feature_path(gap, 'same_day_stat'), 'w')
    flag = True
    for shop in xrange(1, 2001):
        shop = str(shop)
        print shop
        arr = util.toArray(data[shop])
        for date in util.getDate(start_date[shop]):
            feature, msg = getFeature(date, arr, gap)
            if flag:
                fout.write('%s\n' % (','.join(msg)))
                flag = False
            util.outputFeature(fout, date, shop, feature)
    fout.close()
コード例 #2
0
ファイル: time_window_diff.py プロジェクト: upperli/ijcai2017
def run(gap):
    data = helper.loadShopPay()
    start_date = util.getLabelStartDate(data)

    fout = open(
        helper.get_feature_path(
            gap, 'time_win_diff_%s_%s_%s' %
            (sys.argv[2], sys.argv[3], sys.argv[4])), 'w')
    flag = True
    for shop in xrange(1, 2001):
        shop = str(shop)
        print shop

        arr = util.toArray(data[shop])
        #arr = util.fillNull(arr)
        for date in util.getDate(start_date[shop]):
            feature, msg = getFeature(date, arr, gap)
            if flag:
                fout.write('%s\n' % (','.join(msg)))
                flag = False
            util.outputFeature(fout, date, shop, feature)
    fout.close()