Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
__pycache__
.spyproject/
.DS_Store
*.png
*.dot
Expand Down
6 changes: 3 additions & 3 deletions ft_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ def do(self, logs, para):

if plot_flag == 1:
#画树,dratTreee,画图,放到输出模板之前,是因为traversal_tree函数会修改is_end变量的值,存在bug!!
self.drawTree()#画树,dratTreee,画图
self.drawTree(para)#画树,dratTreee,画图



Expand Down Expand Up @@ -561,7 +561,7 @@ def do(self, logs, para):
# print "\ntemplate_count:",count
return all_paths

def drawTree(self):
def drawTree(self, para):
#draw trees
import pygraphviz as pgv
A=pgv.AGraph(directed=True,strict=True)
Expand Down Expand Up @@ -600,7 +600,7 @@ def drawTree(self):
A.add_edge(cur_father,cur_child)
A.write('fooOld.dot')
A.layout('dot') # layout with dot
A.draw('Trace.png') # write to file
A.draw(para['picture_path']) # write to file


def RecursionPreOrder(node):
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Our paper is published on IEEE/ACM International Symposium on Quality of Service
### 训练日志模板:
* 输出文件:模板、单词词频列表
* 运行脚本的的命令:
* python ft\_tree.py -FIRST\_COL 0 -NO\_CUTTING 1 -CUTTING\_PERCENT 0.3 -data\_path ./training.log -template_path ./output.template -fre\_word\_path ./output.fre -picture\_path ./tree.png -leaf\_num 4 -short\_threshold 5 -plot\_flag 1
* python ft\_tree.py -FIRST\_COL 0 -NO\_CUTTING 1 -CUTTING\_PERCENT 0.3 -train_log_path ./training.log -template_path ./output.template -fre\_word\_path ./output.fre -picture\_path ./tree.png -leaf\_num 4 -short\_threshold 5 -plot\_flag 1
* 参数样例:
* FIRST\_COL 每行日志从第几列作为输入,默认为0
* NO\_CUTTING = 0 #初步设定1时,是前30% 不剪枝 ,全局开关, 当其为0时,全局按照min_threshold剪枝
Expand Down