-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo_all.R
120 lines (92 loc) · 1.67 KB
/
demo_all.R
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
## demo
rm(list = ls())
setwd("C:\\Users\\kevin\\Desktop\\YourDir") ## change to the direcotry including all source codes and datasets
source("ppmiCFDTI.R")
dat <- c("hao", "kuang", "e")
for (db in dat) {
## 1.1
## just pure similarity
## PPMI
ppmiCFDTI(
db = db,
nfold = 10,
nsplit = 5,
simMethod = "PPMI"
)
## tanimoto
ppmiCFDTI(
db = db,
nfold = 10,
nsplit = 5,
simMethod = "tanimoto"
)
## cosine
ppmiCFDTI(
db = db,
nfold = 10,
nsplit = 5,
simMethod = "cosine"
)
## DTHybrid ###
ppmiCFDTI(
db = db,
nfold = 10,
nsplit = 5,
hasDTHybrid = TRUE
)
## strategy 2
## svd
## PPMI
ppmiCFDTI(
db = db,
nfold = 10,
nsplit = 5,
simMethod = "PPMI",
isLowRankApprox = TRUE,
lowRankMethod = "SVD"
)
## tanimoto
ppmiCFDTI(
db = db,
nfold = 10,
nsplit = 5,
simMethod = "tanimoto",
isLowRankApprox = TRUE,
lowRankMethod = "SVD"
)
## cosine
ppmiCFDTI(
db = db,
nfold = 10,
nsplit = 5,
simMethod = "cosine",
isLowRankApprox = TRUE,
lowRankMethod = "SVD"
)
## strategy 3
## smoothing
## PPMI
ppmiCFDTI(
db = db,
nfold = 10,
nsplit = 5,
simMethod = "PPMI",
smoothing = TRUE
)
## tanimoto
ppmiCFDTI(
db = db,
nfold = 10,
nsplit = 5,
simMethod = "tanimoto",
smoothing = TRUE
)
## cosine
ppmiCFDTI(
db = db,
nfold = 10,
nsplit = 5,
simMethod = "cosine",
smoothing = TRUE
)
}