Esempio n. 1
0
import experiments as exp
import modifier as mdf
import re

paths=['swSims.p','swSimsL.p','dmSims.p','dmSimsL.p',\
       'lengthSims.p']
names=['swAlign','swAlign-Length','directMatch',\
       'directMatchL','lengthOnly']

netpath='netdata.p'

(edges,ciss,proms)=exp.getPickle(netpath)

filt1=[]
filt2=[]
#ratio=0.99
#filt1=mdf.random_remove(edges.keys(),ratio)


'''
for cis in ciss.keys():
    entry=ciss[cis]
    target=entry.promname
    target= re.sub(r'p\d?$','',target).upper()
    source=entry.tfname.upper()
    if not (source,target) in filt1:
        filt1.append((source,target))


for elem in filt1:
    print elem[0],'R',elem[1]
Esempio n. 2
0
import experiments as exp
from yxtools import dictInsert
import math
import matplotlib.pyplot as plt
import operator
(edges,ciss,proms)=exp.getPickle('netdata.p')

transactions=exp.getTS(edges,ciss,proms)

rules=exp.getAssoc(transactions,min_s=2,\
                   min_c=0.5)

# Determine the relationship between support and
# size of frequent itemset


(perfs,maks)=exp.evalCisCollection(rules,weighted=True)

'''
y=[[],[],[],[],[]]

for i in perfs.keys():
    for elem in perfs[i]:
        y[i-1].append(elem)
'''
x=[]
for key in maks.keys():
    x.append(len(maks[key][0])+1)

plt.hist(x)
plt.show()