forked from LucasSouzaa/tcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
analiseAtributeSelectionRaker.R
83 lines (76 loc) · 4.07 KB
/
analiseAtributeSelectionRaker.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
library(RColorBrewer)
table <- read.table(file = "atributeSelectionRankerV5.csv", sep=",", header = T)
aucInterval <- seq(from = 1, to = 27, by = 3)
sensibilityInterval <- seq(from = 2, to = 27, by = 3)
specificityInterval <- seq(from = 3, to = 27, by = 3)
#colors:
cols<-brewer.pal(n=9,name="Set1")
colors = 1
par(mai = c(1.5, 1, .5, 1)) # Right margin space for legend
plot(-1, -1,ylim = c(0.4, 1), xlim = c(0, 290),main = "AUC changing as the number of attributes increases"
,ylab = "AUC", xlab = "Number of Attributes")
for(i in aucInterval){
lines(table[,i], col=cols[colors])
points(table[,i], pch = colors, col=cols[colors])
colors = colors+1
}
abline(h=max(table[,aucInterval]), col="red")
legend(x = 300, y = 0.7, # Location of legend
xpd = TRUE, # Allow drawing outside plot area
xjust = 0, # Left justify legend box on x
yjust = .5, # Center legend box on y
legend = c("NB","MLP", "K=1", "K=2", "K=3", "K=4", "K=5", "J48", "RF"), # Legend Text
col = cols[1:9], # Legend Element Colors
pch = seq(from=1, to=9, by=1), # Legend Element Styles
title = "Label", # Legend Title
title.col = gray(.2), # Legend title color
box.lty = 1, # Legend box line type
box.lwd = 2) # Legend box line width
tableAUC <- table[ ,aucInterval]
write.csv(tableAUC, file = "AUCSelectAtributosFinal.csv")
for(i in aucInterval){
print(max(table[,i]))
print(which((table[,i] == max(table[,i]) )))
}
#plot Sensibility
par(mai = c(1.5, 1, .5, 1)) # Right margin space for legend
plot(-1, -1,ylim = c(0.2, 1), xlim = c(0, 290),main = "Sensitivity changing as the number of attributes increases"
,ylab = "Sensibility", xlab = "Number of Attributes")
for(i in sensibilityInterval){
lines(table[,i], col=cols[colors])
points(table[,i], pch = colors, col=cols[colors])
colors = colors+1
}
abline(h=max(table[,sensibilityInterval]), col="red")
legend(x = 300, y = 0.7, # Location of legend
xpd = TRUE, # Allow drawing outside plot area
xjust = 0, # Left justify legend box on x
yjust = .5, # Center legend box on y
legend = c("NB","MLP", "K=1", "K=2", "K=3", "K=4", "K=5", "J48", "RF"), # Legend Text
col = cols[1:9], # Legend Element Colors
pch = seq(from=1, to=9, by=1), # Legend Element Styles
title = "Label", # Legend Title
title.col = gray(.2), # Legend title color
box.lty = 1, # Legend box line type
box.lwd = 2) # Legend box line width
#plot specificity
par(mai = c(1.5, 1, .5, 1)) # Right margin space for legend
plot(-1, -1,ylim = c(0.4, 1), xlim = c(0, 290),main = "Specificity changing as the number of attributes increases"
,ylab = "Specificity", xlab = "Number of Attributes")
for(i in specificityInterval){
lines(table[,i], col=cols[colors])
points(table[,i], pch = colors, col=cols[colors])
colors = colors+1
}
abline(h=max(table[,specificityInterval]), col="red")
legend(x = 300, y = 0.7, # Location of legend
xpd = TRUE, # Allow drawing outside plot area
xjust = 0, # Left justify legend box on x
yjust = .5, # Center legend box on y
legend = c("NB","MLP", "K=1", "K=2", "K=3", "K=4", "K=5", "J48", "RF"), # Legend Text
col = cols[1:9], # Legend Element Colors
pch = seq(from=1, to=9, by=1), # Legend Element Styles
title = "Label", # Legend Title
title.col = gray(.2), # Legend title color
box.lty = 1, # Legend box line type
box.lwd = 2) # Legend box line width