Commit 8b33d0be authored by Kamil Jurek's avatar Kamil Jurek
Browse files

rules mining analyzis started

No related merge requests found
Showing with 17950 additions and 4 deletions
+17950 -4
plots/plot_sequence_2017_11_28-18.07.57.png

29 KB

rules = []
with open('output.txt', 'r') as f:
for line in f:
line = line.replace(' ', '')
splitted = line.split('==>')
lhs = splitted[0]
rhs = splitted[1].split('#')[0]
sup = splitted[1].split('#')[1]
conf = splitted[1].split('#')[2]
if lhs in rhs:
splitted = rhs.split(lhs)
head = splitted[0]
tail = splitted[1]
#print(tail, head)
if tail:
rule = lhs + '==>' +tail
if rule not in rules:
rules.append(rule)
#print(lhs, '==>', tail)
#print("-------------------")
#else:
#print(lhs, '===>', rhs)
#print(lhs, rhs, sup, conf)
for r in rules:
print(r)
This diff is collapsed.
This diff is collapsed.
2 -1 2 -1 3 -1 3 -1 2 -1 2 -1 2 -1 4 -1 4 -1 5 -1 5 -1 5 -1 -2
2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 3 -1 3 -1 3 -1 3 -1 3 -1 3 -1 3 -1 3 -1 3 -1 3 -1 3 -1 3 -1 3 -1 3 -1 3 -1 3 -1 3 -1 3 -1 3 -1 3 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 2 -1 4 -1 4 -1 4 -1 4 -1 4 -1 4 -1 4 -1 4 -1 4 -1 4 -1 4 -1 4 -1 4 -1 4 -1 4 -1 4 -1 4 -1 4 -1 4 -1 4 -1 4 -1 4 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 5 -1 -2
......@@ -8,6 +8,9 @@ from detector import OnlineSimulator
from zscore_detector import ZScoreDetector
from math import gcd
def myround(x, base=10):
return int(base * round(float(x)/base))
#Numerical data
#df = pd.read_csv('sequences/sequence_2017_11_22-19.55.44.csv')
df = pd.read_csv('sequences/sequence_2017_11_28-18.07.57.csv')
......@@ -33,10 +36,12 @@ print(np.array(stops))
subseqs = []
indexes = []
gcd_ = stops[0]
first = round(stops[0], -1)
roundTo = 100
first = myround(stops[0], roundTo)
for i in np.arange(0, len(stops)-1):
s = round(stops[i], -1)
e = round(stops[i+1], -1)
s = myround(stops[i], roundTo)
e = myround(stops[i+1], roundTo)
indexes.append(s-first)
if i == len(stops)-2:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment