import sys import os sys.path.append(os.path.abspath("../preprocessing/")) import features_preprocessing as fp import submission_preprocessing as sp import submission_postprocess as pp import pandas as pd postprocess = pp.submission_postprocess() data = pd.read_table('predictions.txt') print(data) postprocess.premier_submit(pred=data)
xa = x['ASS_ID'] xt = x['TIME'] yd = x['YEAR_DAY'] xy = x['YEAR'] #if xa == 35: d = data.query('WEEK_DAY == @xwd and ASS_ID ==@xa and TIME == @xt and YEAR == @xy') #else: # d = data.query('WEEK_DAY == @xwd and ASS_ID ==@xa and TIME == @xt') calls = d['CSPL_CALLS'] if calls.empty: prediction.append(0) else: mean = calls.mean() prediction.append(mean) if i%1000 == 0: print(i) print(prediction) post = postpro.submission_postprocess() post.premier_submit(prediction, name = "result_submission_axa3.txt") t2 = time.time() print(t2 - t1) #clf = svm.SVR(kernel='poly', degree=3) #scores = cross_validation.cross_val_score(clf, X_train, Y_train, cv=2) #print(scores)
xa = x['ASS_ID'] xt = x['TIME'] yd = x['YEAR_DAY'] xy = x['YEAR'] #if xa == 35: d = data.query( 'WEEK_DAY == @xwd and ASS_ID ==@xa and TIME == @xt and YEAR == @xy') #else: # d = data.query('WEEK_DAY == @xwd and ASS_ID ==@xa and TIME == @xt') calls = d['CSPL_CALLS'] if calls.empty: prediction.append(0) else: mean = calls.mean() prediction.append(mean) if i % 1000 == 0: print(i) print(prediction) post = postpro.submission_postprocess() post.premier_submit(prediction, name="result_submission_axa3.txt") t2 = time.time() print(t2 - t1) #clf = svm.SVR(kernel='poly', degree=3) #scores = cross_validation.cross_val_score(clf, X_train, Y_train, cv=2) #print(scores)