-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.Rhistory
512 lines (512 loc) · 19.8 KB
/
.Rhistory
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
test <- mushroom[-temp_index,]
train <- mushroom[temp_index,]
start_time <- Sys.time()
model = glm(formula = gill_attachment ~ ., data = train, family = binomial())
#summary(model)
#NA değerler var, bunun sebebi birden fazla attribute un iyi bir şekilde eşleşmesi
#bu durumu istemiyoruz o yüzden NA'lı attributeları kaldırıyoruz
drops <- c("stalk_color_above_ring","stalk_color_below_ring","veil_color","ring_number"
,"ring_type","spore_print_color","habitat") #we remove this column in our dataset.
train <- train[ , !(names(train) %in% drops)] #remove
test <- test[ , !(names(test) %in% drops)] #remove
#Warning: glm.fit: algorithm did not converge hatası iterasyon sayısı ile ilgili
#default olarak maxit=25'dir biz 100 yapıyoruz
model <- glm(gill_attachment ~ ., data = train,family = binomial,maxit = 100)
#summary(model)
#şimdi modeli test datamız üzerinde test ediyoruz
predicted <- predict.glm(model,newdata = test[,-7],type = "response")
#tahmin edilen değerlerin 0.5 üzeri olanlar poison
predicted <- predicted >= 0.5
predicted <- gsub("FALSE","a",predicted)
predicted <- gsub("TRUE","f",predicted)
actual <- test[,5]
train_err <- mean(predicted != train$gill_attachment)
confusion_matrix <- table(predicted,actual)
TP <- confusion_matrix[2,2]
TN <- confusion_matrix[1,1]
FP <- confusion_matrix[2,1]
FN <- confusion_matrix[1,2]
Accuracy <- (TP+TN)*100/(TP+TN+FP+FN)
Recall <- TP*100/(TP+FN)
F_Score <- 2*TP*100/(2*TP+FP+FN)
Precision <- TP*100/(TP+FP)
end_time <- Sys.time()
AccList <- c(AccList, Accuracy)
RecList <- c(RecList, Recall)
FscList <- c(FscList, F_Score)
PrcList <- c(PrcList, Precision)
print(paste(i, "-> running time => ", (end_time-start_time), "Accuracy : ", Accuracy,
" Recall : ", Recall
," F-Score : ", F_Score
," Precision : ", Precision))
}
mushroom <- read.csv("agaricus-lepiota.csv",header = TRUE) # load dataset
summary(mushroom)
head(mushroom)
class_count <- table(mushrooms$class)
class_count <- table(mushroom$class)
class_count
class_count <- table(mushroom$class)
class_proportion <- class_count[2]/(class_count[1]+class_count[2])
print("Natural poison rate->")
class_proportion
View(proportions_tab)
View(mushroom)
class_count <- table(mushroom$bruises)
class_proportion <- class_count[2]/(class_count[1]+class_count[2])
print("Natural buises rate->")
class_proportion
ComputeProportion <- function(target,attribute_dataset,Columns,centroid){
len_attr <- length(Columns)
RMSE <- NULL
for(i in 1:len_attr){
tab <- table(target,attribute_dataset[,Columns[i]])
prop <- tab[2,]/(tab[1,]+tab[2,])
centr_prop <- prop - centroid
Err <- sqrt(mean(centr_prop*centr_prop))
RMSE <-rbind(RMSE,Err)
}
norm_err <- (RMSE-min(RMSE))/(max(RMSE)-min(RMSE))
err_mat <- cbind(colnames(mushroom[,Columns]),RMSE)
err_mat <- cbind(err_mat,norm_err)
colnames(err_mat) <- c("Column name","RMSE","Norm. Error")
err_mat
}
col<-c(2:23)
secondCol<-c(1:23)
secondCol<-secondCol[-4]
proportions_tab <- ComputeProportion(mushroom[,1],mushroom,col,0.482)
print(proportions_tab)
proportions_tab <- ComputeProportion(mushroom[,5],mushroom,secondCol,0.415)
print(proportions_tab)
View(mushroom)
sums <- NULL
for(i in 1:length(mushroom)){
sums <- c(sums, sum(is.na(mushroom[,i])))
}
numMissData <- data.frame("column" = columnNames, "numberOfMissingData" = sums )
missmap(mushroom, main = "Missing values vs observed") # plot missing data distrubition
numMissData <- data.frame("numberOfMissingData" = sums )
sums <- NULL
for(i in 1:length(mushroom)){
sums <- c(sums, sum(is.na(mushroom[,i])))
}
numMissData <- data.frame("numberOfMissingData" = sums )
missmap(mushroom, main = "Missing values vs observed") # plot missing data distrubition
#show missing data in a table
library(Amelia)
sums <- NULL
for(i in 1:length(mushroom)){
sums <- c(sums, sum(is.na(mushroom[,i])))
}
numMissData <- data.frame("numberOfMissingData" = sums )
missmap(mushroom, main = "Missing values vs observed") # plot missing data distrubition
mushroom <- read.csv("agaricus-lepiota.csv",header = TRUE) # load dataset
library(Amelia)
sums <- NULL
for(i in 1:length(mushroom)){
sums <- c(sums, sum(is.na(mushroom[,i])))
}
numMissData <- data.frame("numberOfMissingData" = sums )
missmap(mushroom, main = "Missing values vs observed") # plot missing data distrubition
mushroom <- read.csv("agaricus-lepiota.csv",header = TRUE) # load dataset
#show missing data in a table
library(Amelia)
sums <- NULL
for(i in 1:length(mushroom)){
sums <- c(sums, sum(is.na(mushroom[,i])))
}
numMissData <- data.frame("numberOfMissingData" = sums )
missmap(mushroom, main = "Missing values vs observed") # plot missing data distrubition
mushroom <- read.csv("agaricus-lepiota.csv",header = TRUE) # load dataset
missmap(mushroom, main = "Missing values vs observed") # plot missing data distrubition
missmap(mushroom, main = "Missing values vs observed") # plot missing data distrubition
columnNames <- c(
"class", "cap_shape", "cap_surface",
"cap_color", "bruises", "odor",
"gill_attachement", "gill_spacing", "gill_size",
"gill_color", "stalk_shape", "stalk_root",
"stalk_surface_above_ring", "stalk_surface_below_ring", "stalk_color_above_ring",
"stalk_color_below_ring", "veil_color",
"ring_number", "ring_type", "spore_print_color",
"population", "habitat")
library(Amelia)
sums <- NULL
for(i in 1:length(mushroom)){
sums <- c(sums, sum(is.na(mushroom[,i])))
}
numMissData <- data.frame("column" = columnNames,"numberOfMissingData" = sums )
missmap(mushroom, main = "Missing values vs observed") # plot missing data distrubition
mushroom <- read.csv("agaricus-lepiota.csv",header = TRUE) # load dataset
columnNames <- c(
"class", "cap_shape", "cap_surface",
"cap_color", "bruises", "odor",
"gill_attachement", "gill_spacing", "gill_size",
"gill_color", "stalk_shape", "stalk_root",
"stalk_surface_above_ring", "stalk_surface_below_ring", "stalk_color_above_ring",
"stalk_color_below_ring", "veil_color",
"ring_number", "ring_type", "spore_print_color",
"population", "habitat")
library(Amelia)
sums <- NULL
for(i in 1:length(mushroom)){
sums <- c(sums, sum(is.na(mushroom[,i])))
}
numMissData <- data.frame("column" = columnNames,"numberOfMissingData" = sums )
library(Amelia)
sums <- NULL
for(i in 1:length(mushroom)){
sums <- c(sums, sum(is.na(mushroom[,i])))
}
numMissData <- data.frame("numberOfMissingData" = sums )
missmap(mushroom, main = "Missing values vs observed") # plot missing data distrubition
#show missing data in a table
any(is.na(mushroom))
mushroom <- read.csv("agaricus-lepiota.csv",header = TRUE,na.strings=c("",".","NA")) # load dataset
#show missing data in a table
any(is.na(mushroom))
View(mushroom)
mushroom <- read.csv("agaricus-lepiota.csv",header = TRUE,na.strings=c("","?","NA")) # load dataset
#show missing data in a table
any(is.na(mushroom))
mushroom <- read.csv("agaricus-lepiota.csv",header = TRUE,na.strings=c("?","NA")) # load dataset
#show missing data in a table
any(is.na(mushroom))
missmap(mushroom, main = "Missing values vs observed") # plot missing data distrubition
missmap(mushroom, main = "Missing values vs observed") # plot missing data distrubition
mushroom <- read.csv("agaricus-lepiota.csv",header = TRUE,na.strings=c("?","NA")) # load dataset
#include data preparation file
source(file = "Preparation.R") # just shows worked dataset after data preparation.
#----------------Gill_attachment
TRAIN_SIZE = 0.8
NUM_OF_FOLD = 10
TRAIN_DATA = list()
#show current dataset
#head(mushroom)
#summary(mushroom)
set.seed(5) #Set the seed for reproducibility
for(i in 1:(NUM_OF_FOLD+1)){
train_index <- sample(1:nrow(mushroom), size=nrow(mushroom)*TRAIN_SIZE) # randomly choice rows
TRAIN_DATA <- c(TRAIN_DATA, list(train_index))
}
#begin the logistic function (Model fitting)
AccList <- NULL
RecList <- NULL
FscList <- NULL
PrcList <- NULL
for(i in 1:(NUM_OF_FOLD)){
temp_index <- unlist(TRAIN_DATA[i])
test <- mushroom[-temp_index,]
train <- mushroom[temp_index,]
start_time <- Sys.time()
model = glm(formula = gill_attachment ~ ., data = train, family = binomial())
#summary(model)
#NA değerler var, bunun sebebi birden fazla attribute un iyi bir şekilde eşleşmesi
#bu durumu istemiyoruz o yüzden NA'lı attributeları kaldırıyoruz
drops <- c("stalk_color_above_ring","stalk_color_below_ring","veil_color","ring_number"
,"ring_type","spore_print_color","habitat") #we remove this column in our dataset.
train <- train[ , !(names(train) %in% drops)] #remove
test <- test[ , !(names(test) %in% drops)] #remove
#Warning: glm.fit: algorithm did not converge hatası iterasyon sayısı ile ilgili
#default olarak maxit=25'dir biz 100 yapıyoruz
model <- glm(gill_attachment ~ ., data = train,family = binomial,maxit = 100)
#summary(model)
#şimdi modeli test datamız üzerinde test ediyoruz
predicted <- predict.glm(model,newdata = test[,-7],type = "response")
#tahmin edilen değerlerin 0.5 üzeri olanlar poison
predicted <- predicted >= 0.5
predicted <- gsub("FALSE","a",predicted)
predicted <- gsub("TRUE","f",predicted)
actual <- test[,5]
train_err <- mean(predicted != train$gill_attachment)
confusion_matrix <- table(predicted,actual)
TP <- confusion_matrix[2,2]
TN <- confusion_matrix[1,1]
FP <- confusion_matrix[2,1]
FN <- confusion_matrix[1,2]
Accuracy <- (TP+TN)*100/(TP+TN+FP+FN)
Recall <- TP*100/(TP+FN)
F_Score <- 2*TP*100/(2*TP+FP+FN)
Precision <- TP*100/(TP+FP)
end_time <- Sys.time()
AccList <- c(AccList, Accuracy)
RecList <- c(RecList, Recall)
FscList <- c(FscList, F_Score)
PrcList <- c(PrcList, Precision)
print(paste(i, "-> running time => ", (end_time-start_time), "Accuracy : ", Accuracy,
" Recall : ", Recall
," F-Score : ", F_Score
," Precision : ", Precision))
}
#include data preparation file
source(file = "Preparation.R") # just shows worked dataset after data preparation.
View(mushroom)
TRAIN_SIZE = 0.8
NUM_OF_FOLD = 10
TRAIN_DATA = list()
set.seed(5) #Set the seed for reproducibility
for(i in 1:(NUM_OF_FOLD+1)){
train_index <- sample(1:nrow(mushroom), size=nrow(mushroom)*TRAIN_SIZE) # randomly choice rows
TRAIN_DATA <- c(TRAIN_DATA, list(train_index))
}
#begin the logistic function (Model fitting)
AccList <- NULL
RecList <- NULL
FscList <- NULL
PrcList <- NULL
for(i in 1:(NUM_OF_FOLD)){
temp_index <- unlist(TRAIN_DATA[i])
test <- mushroom[-temp_index,]
train <- mushroom[temp_index,]
start_time <- Sys.time()
model = glm(formula = gill_attachment ~ ., data = train, family = binomial())
#summary(model)
#NA değerler var, bunun sebebi birden fazla attribute un iyi bir şekilde eşleşmesi
#bu durumu istemiyoruz o yüzden NA'lı attributeları kaldırıyoruz
drops <- c("stalk_color_above_ring","stalk_color_below_ring","veil_color","ring_number"
,"ring_type","spore_print_color","habitat") #we remove this column in our dataset.
train <- train[ , !(names(train) %in% drops)] #remove
test <- test[ , !(names(test) %in% drops)] #remove
#Warning: glm.fit: algorithm did not converge hatası iterasyon sayısı ile ilgili
#default olarak maxit=25'dir biz 100 yapıyoruz
model <- glm(gill_attachment ~ ., data = train,family = binomial,maxit = 100)
#summary(model)
#şimdi modeli test datamız üzerinde test ediyoruz
predicted <- predict.glm(model,newdata = test[,-7],type = "response")
#tahmin edilen değerlerin 0.5 üzeri olanlar poison
predicted <- predicted >= 0.5
predicted <- gsub("FALSE","a",predicted)
predicted <- gsub("TRUE","f",predicted)
actual <- test[,5]
train_err <- mean(predicted != train$gill_attachment)
confusion_matrix <- table(predicted,actual)
TP <- confusion_matrix[2,2]
TN <- confusion_matrix[1,1]
FP <- confusion_matrix[2,1]
FN <- confusion_matrix[1,2]
Accuracy <- (TP+TN)*100/(TP+TN+FP+FN)
Recall <- TP*100/(TP+FN)
F_Score <- 2*TP*100/(2*TP+FP+FN)
Precision <- TP*100/(TP+FP)
end_time <- Sys.time()
AccList <- c(AccList, Accuracy)
RecList <- c(RecList, Recall)
FscList <- c(FscList, F_Score)
PrcList <- c(PrcList, Precision)
print(paste(i, "-> running time => ", (end_time-start_time), "Accuracy : ", Accuracy,
" Recall : ", Recall
," F-Score : ", F_Score
," Precision : ", Precision))
}
View(mushroom)
#include data preparation file
source(file = "Preparation.R") # just shows worked dataset after data preparation.
TRAIN_SIZE = 0.8
NUM_OF_FOLD = 10
TRAIN_DATA = list()
set.seed(5) #Set the seed for reproducibility
for(i in 1:(NUM_OF_FOLD+1)){
train_index <- sample(1:nrow(mushroom), size=nrow(mushroom)*TRAIN_SIZE) # randomly choice rows
TRAIN_DATA <- c(TRAIN_DATA, list(train_index))
}
#begin the logistic function (Model fitting)
AccList <- NULL
RecList <- NULL
FscList <- NULL
PrcList <- NULL
for(i in 1:(NUM_OF_FOLD)){
temp_index <- unlist(TRAIN_DATA[i])
test <- mushroom[-temp_index,]
train <- mushroom[temp_index,]
start_time <- Sys.time()
model = glm(formula = gill_attachment ~ ., data = train, family = binomial())
#summary(model)
#NA değerler var, bunun sebebi birden fazla attribute un iyi bir şekilde eşleşmesi
#bu durumu istemiyoruz o yüzden NA'lı attributeları kaldırıyoruz
drops <- c("stalk_color_above_ring","stalk_color_below_ring","veil_color","ring_number"
,"ring_type","spore_print_color","habitat") #we remove this column in our dataset.
train <- train[ , !(names(train) %in% drops)] #remove
test <- test[ , !(names(test) %in% drops)] #remove
#Warning: glm.fit: algorithm did not converge hatası iterasyon sayısı ile ilgili
#default olarak maxit=25'dir biz 100 yapıyoruz
model <- glm(gill_attachment ~ ., data = train,family = binomial,maxit = 100)
#summary(model)
#şimdi modeli test datamız üzerinde test ediyoruz
predicted <- predict.glm(model,newdata = test[,-7],type = "response")
#tahmin edilen değerlerin 0.5 üzeri olanlar poison
predicted <- predicted >= 0.5
predicted <- gsub("FALSE","a",predicted)
predicted <- gsub("TRUE","f",predicted)
actual <- test[,5]
train_err <- mean(predicted != train$gill_attachment)
confusion_matrix <- table(predicted,actual)
TP <- confusion_matrix[2,2]
TN <- confusion_matrix[1,1]
FP <- confusion_matrix[2,1]
FN <- confusion_matrix[1,2]
Accuracy <- (TP+TN)*100/(TP+TN+FP+FN)
Recall <- TP*100/(TP+FN)
F_Score <- 2*TP*100/(2*TP+FP+FN)
Precision <- TP*100/(TP+FP)
end_time <- Sys.time()
AccList <- c(AccList, Accuracy)
RecList <- c(RecList, Recall)
FscList <- c(FscList, F_Score)
PrcList <- c(PrcList, Precision)
print(paste(i, "-> running time => ", (end_time-start_time), "Accuracy : ", Accuracy,
" Recall : ", Recall
," F-Score : ", F_Score
," Precision : ", Precision))
}
missmap(mushroom, main = "Missing values vs observed") # plot missing data distrubition
mushroom <- read.csv("agaricus-lepiota.csv",header = TRUE,na.strings=c("?","NA")) # load dataset
#replace NA values to columns mode
Mode <- function (x, na.rm) {
xtab <- table(x)
xmode <- names(which(xtab == max(xtab)))
if (length(xmode) > 1) xmode <- ">1 mode"
return(xmode)
}
for (var in 1:ncol(mushroom)) {
mushroom[is.na(mushroom[,var]),var] <- Mode(mushroom[,var], na.rm = TRUE)
}
#--------------------
#doğal değerlerini buluyoruz proportion kısmında lazım olacak
class_count <- table(mushroom$class)
class_proportion <- class_count[2]/(class_count[1]+class_count[2])
print("Natural poison rate->")
class_proportion
class_count <- table(mushroom$bruises)
class_proportion <- class_count[2]/(class_count[1]+class_count[2])
print("Natural buises rate->")
class_proportion
#dönen değer ne kadar büyükse sınıflandırma için o kadar önemlidir.
#columns target dışında yer alan diğer attributesları alır
#parametre olarak verilen centroid değeri dogal posion değeridir
ComputeProportion <- function(target,attribute_dataset,Columns,centroid){
len_attr <- length(Columns)
RMSE <- NULL
for(i in 1:len_attr){
tab <- table(target,attribute_dataset[,Columns[i]])
prop <- tab[2,]/(tab[1,]+tab[2,])
centr_prop <- prop - centroid
Err <- sqrt(mean(centr_prop*centr_prop))
RMSE <-rbind(RMSE,Err)
}
norm_err <- (RMSE-min(RMSE))/(max(RMSE)-min(RMSE))
err_mat <- cbind(colnames(mushroom[,Columns]),RMSE)
err_mat <- cbind(err_mat,norm_err)
colnames(err_mat) <- c("Column name","RMSE","Norm. Error")
err_mat
}
col<-c(2:23)
secondCol<-c(1:23)
secondCol<-secondCol[-4]
proportions_tab <- ComputeProportion(mushroom[,1],mushroom,col,0.482)
print(proportions_tab)
mushroom <- read.csv("agaricus-lepiota.csv",header = TRUE,na.strings=c("?","NA")) # load dataset
ComputeProportion <- function(target,attribute_dataset,Columns,centroid){
len_attr <- length(Columns)
RMSE <- NULL
for(i in 1:len_attr){
tab <- table(target,attribute_dataset[,Columns[i]])
prop <- tab[2,]/(tab[1,]+tab[2,])
centr_prop <- prop - centroid
Err <- sqrt(mean(centr_prop*centr_prop))
RMSE <-rbind(RMSE,Err)
}
norm_err <- (RMSE-min(RMSE))/(max(RMSE)-min(RMSE))
err_mat <- cbind(colnames(mushroom[,Columns]),RMSE)
err_mat <- cbind(err_mat,norm_err)
colnames(err_mat) <- c("Column name","RMSE","Norm. Error")
err_mat
}
col<-c(2:23)
secondCol<-c(1:23)
secondCol<-secondCol[-4]
proportions_tab <- ComputeProportion(mushroom[,1],mushroom,col,0.482)
boxplot(proportions_tab)
proportions_tab
proportions_tab[[1]]
proportions_tab[1]
typeof(proportions_tab)
proportions_tab[,1:2]
proportions_tab[,1]
boxplot(proportions_tab[,1],proportions_tab[,3])
boxplot(proportions_tab[,3])
proportions_tab[,3]
plot(mushroom$gill_attachment)
plot(proportions_tab[,3])
plot(proportions_tab[,3])
plot(proportions_tab)
barplot(proportions_tab)
barplot(proportions_tab[,3])
barplot(proportions_tab[,3],main=proportions_tab)
plot(proportions_tab[,3])
plot(proportions_tab[,3],labels=proportions_tab[,2])
plot(proportions_tab[,3],labels=c("Mon", "Tue", "Wed", "Thu", "Fri"))
plot(proportions_tab[,3])
plot(proportions_tab[,3],axes=FALSE, ann=FALSE)
plot(proportions_tab[,3],axes=FALSE, ann=FALSE)
plot(proportions_tab[,3],at=1:5, lab=c("Mon","Tue","Wed","Thu","Fri"))
plot(proportions_tab[,3],at=1:5, lab=proportions_tab[,2])
plot(proportions_tab[,3],at=1:length(proportions_tab[,2]), lab=proportions_tab[,2])
plot(proportions_tab[,3],lab=proportions_tab[,2])
length(proportions_tab[,3])
length(proportions_tab[,2])
print(lab=proportions_tab[,2])
print(proportions_tab[,2])
print(proportions_tab[,1])
plot(proportions_tab[,3],lab=proportions_tab[,1])
barplot(proportions_tab[,3], main="Cars", xlab="Days",
ylab="Total", names.arg=lab=proportions_tab[,1],
border="blue", density=c(10,20,30,40,50))
barplot(proportions_tab[,3], main="Cars", xlab="Days",
ylab="Total", names.arg=lab=proportions_tab[,1])
barplot(proportions_tab[,3], main="Cars", xlab="Days",
ylab="Total", names.arg=lab=proportions_tab[,1],
border="blue", density=c(10,20,30,40,50))
barplot(proportions_tab[,3], main="Cars", xlab="Days",
ylab="Total", names.arg=lab=proportions_tab[,1],
border="blue")
barplot(proportions_tab[,3], xlab="Days",
ylab="Total", names.arg=proportions_tab[,1],
border="blue")
proportions_tab[,3]
as.numeric(proportions_tab[,3])
barplot(as.numeric(proportions_tab[,3]), xlab="Days",
ylab="Total", names.arg=proportions_tab[,1],
border="blue")
barplot(as.numeric(proportions_tab[,3]), xlab="Importance Level",
names.arg=proportions_tab[,1],
border="blue")
barplot(as.numeric(proportions_tab[,3]), xlab="Importance Level",
names.arg=proportions_tab[,1],
border="blue",fill=rainbow(5))
barplot(as.numeric(proportions_tab[,3]), xlab="Importance Level",
names.arg=proportions_tab[,1],
border="blue",fill=rainbow(22))
barplot(as.numeric(proportions_tab[,3]), xlab="Importance Level",
names.arg=proportions_tab[,1],
border="blue", col=rainbow(5))
barplot(as.numeric(proportions_tab[,3]), xlab="Importance Level",
names.arg=proportions_tab[,1],
border="blue", col=rainbow(2))
barplot(as.numeric(proportions_tab[,3]), xlab="Importance Level",
names.arg=proportions_tab[,1],
border="blue", col=rainbow(3))
barplot(as.numeric(proportions_tab[,3]), xlab="Importance Level",
names.arg=proportions_tab[,1],
border="blue", col=rainbow(3),las=2)
barplot(as.numeric(proportions_tab[,3]), ylab="Importance Level",
names.arg=proportions_tab[,1],
border="blue", col=rainbow(3),las=2)
barplot(as.numeric(proportions_tab[,3]), ylab="Importance Level for edibility",
names.arg=proportions_tab[,1],
border="blue", col=rainbow(3),las=2)
View(mushroom)
proportions_tab <- ComputeProportion(mushroom[,5],mushroom,secondCol,0.415)
print(proportions_tab)
barplot(as.numeric(proportions_tab[,3]), ylab="Importance Level for bruises",
names.arg=proportions_tab[,1],
border="blue", col=rainbow(3),las=2)