-
Notifications
You must be signed in to change notification settings - Fork 1
/
example2.m
executable file
·40 lines (29 loc) · 1.17 KB
/
example2.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
% =======================================================================
% author: Xueqing Liu
% =======================================================================
% Chi Wang et al., Towards Interactive Construction of Topical Hierarchy: A
% Recursive Tensor Decomposition Approach, KDD 2015.
% =================================================
% Example 2: MER case 1: t2 is identical to the lca of t1 and t2
% ==================================================
global vocabulary parentfolder datafolder
parentfolder = '.';
datafolder = 'data';
dataname = 'dblptitle';
path([parentfolder, '/DataProcess/readdata/'], path);
path([parentfolder, '/Library/'], path);
%LoadData;
SetParameters;
t.tree = node([], [], [], '1', 1:size(vocabulary, 1));
EXP(t, [], 2, dwmat, options);
EXP(t, [1], 2, dwmat, options);
EXP(t, [1, 1], 2, dwmat, options);
EXP(t, [1, 1, 1], 2, dwmat, options);
EXP(t, [1, 1, 1, 1], 2, dwmat, options);
MER(t, [1], [1, 1, 1, 1]);
fid = fopen([datafolder, '/', dataname '/tree.txt'], 'w');
DFSprint(t.tree, fid, '');
fclose(fid);
matfile = [datafolder, '/', dataname '/tree.mat'];
save(matfile,'t');