-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprocessWeaklyAssFeats.R
More file actions
48 lines (38 loc) · 842 Bytes
/
processWeaklyAssFeats.R
File metadata and controls
48 lines (38 loc) · 842 Bytes
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
processWeaklyAssFeats <- function(myweakdata, beta, classficn_ind)
{
library("entropy")
ftsubsetcount <- round((ncol(myweakdata)*beta),0)
ftnames <- c()
ftsubsetnames <- c()
ftnames <- names(myweakdata)
x <- ncol(myweakdata)
corc <- c()
if (classficn_ind == 0 ){
for(i in 1:(x-1))
{
freqs2d = rbind( c(myweakdata[,i]), myweakdata[,x])
corc[i] <- mi.plugin(freqs2d)
}
}
if (classficn_ind == 1 ){
for(i in 1:x)
{
corc[i] <- entropy.ChaoShen(myweakdata[,-i], unit=c("log2"))
}
}
y <- c()
y$corc <- corc
ranken <- rank(-y$corc)
if (classficn_ind == 0 ){
x <- x - 1
}
for (i in 1:ftsubsetcount){
for (j in 1:x)
{
if (ranken[j] == i){
ftsubsetnames <- c(ftsubsetnames, ftnames[j])
}
}
}
return(ftsubsetnames)
}