def analyze_dtw_vs_naive():
    res = parse_matchpredictions(mp)
    shotprobdom,shotprobother,is_shot = res[3],res[4],res[5]
    res = parse_matchpredictions(naivematchpredictions)
    shotprobdomN,shotprobotherN = res[3],res[4]
    plot_roc_curves([1 if s == 1 else 0 for s in is_shot],
                    [shotprobdom,shotprobdomN],
                    #["k-NN with\nDynamic\nTime Warping",
                     #"k-NN with\nNaive\nDistance Metric"]
                     ["Our model","Naive baseline"])
    shotprobs = list()
    for matchid in matchids:
        predictionsfile = '../../data/results/' + str(matchid) + postfix
        mp = np.loadtxt(predictionsfile)
        if dom:
            shotprobs.append(mp[:,3])
            is_shot.append([1 if x == 1 else 0 for x in mp[:,5]])
        else:
            shotprobs.append(mp[:,4])
            is_shot.append([1 if x == -1 else 0 for x in mp[:,5]])
        
    return shotprobs,is_shot
    #all_shotprobs = [pred for pred in s for s in shotprob]

dom = False
preds,ys = load_all_matches("_dtw",dom)
preds_n = load_all_matches("_naive",dom)[0]

scores = [roc_auc_score(y,p) for p,y in zip(preds,ys)]
#plt.hist(scores)

allpred = list([x for z in preds for x in z])
allpred_n = list([x for z in preds_n for x in z])
ally = list([x for z in ys for x in z])
print(len(ally)/69)
print(sum(ally)/69)
#Iprint(set(ally))
plot_roc_curves(ally,[allpred,allpred_n],["Ons model met DTW","Naief basismodel"])
#plot_a_fuckload_of_roc_curves(ys,[preds,preds_n],["Ons model met DTW","Naief basismodel"])
#plot_rocauc_hist(ys,[preds,preds_n],["Ons model met DTW","Naief basismodel"])
print kstest_roc_auc(ys,[preds,preds_n])