Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gkhnkul committed Nov 16, 2017
2 parents 3897b6f + 57bfbdd commit ca4445b
Show file tree
Hide file tree
Showing 14 changed files with 570 additions and 57 deletions.
512 changes: 512 additions & 0 deletions .Rhistory

Large diffs are not rendered by default.

Binary file modified figure/compare_betacv.pdf
Binary file not shown.
Binary file modified figure/compare_dunn.pdf
Binary file not shown.
Binary file modified figure/compare_silhouette.pdf
Binary file not shown.
Binary file modified figure/module.pdf
Binary file not shown.
Binary file modified figure/sil_bombay_Aligon.pdf
Binary file not shown.
Binary file modified figure/sil_bombay_Aligon_regularization.pdf
Binary file not shown.
Binary file modified figure/sil_googleplus_Aligon.pdf
Binary file not shown.
Binary file modified figure/sil_googleplus_Aligon_regularization.pdf
Binary file not shown.
Binary file modified figure/sil_ub_Aligon.pdf
Binary file not shown.
Binary file modified figure/sil_ub_Aligon_regularization.pdf
Binary file not shown.
56 changes: 25 additions & 31 deletions script_figure_2.R
Original file line number Diff line number Diff line change
@@ -1,36 +1,30 @@
# set working directory
#setwd("~/Downloads/EttuBench")

# load two files evaluation.R and utils.R
source(file = "./evaluation.R")
source(file = "./utils.R")

# load supporting libraries
library(cluster)
library(factoextra)
library(RColorBrewer)

dataset <- read.csv(file = "./data/bombay_queries.csv", header = TRUE, sep = "\t")

distMat <- readDistMat("./data/bombay_aligon.csv")
silhouettePlot(distMat, dataset$label, "./figure/sil_bombay_Aligon.pdf")

distMat <- readDistMat("./data/bombay_aligon_regularization.csv")
silhouettePlot(distMat, dataset$label, "./figure/sil_bombay_Aligon_regularization.pdf")

dataset <- read.csv(file = "./data/ub_queries.csv", header = TRUE, sep = "\t")

distMat <- readDistMat("./data/ub_aligon.csv")
silhouettePlot(distMat, dataset$label, "./figure/sil_ub_Aligon.pdf")

distMat <- readDistMat("./data/ub_aligon_regularization.csv")
silhouettePlot(distMat, dataset$label, "./figure/sil_ub_Aligon_regularization.pdf")

dataset <- read.csv(file = "./data/googleplus_queries.csv", header = TRUE, sep = "\t")

distMat <- readDistMat("./data/googleplus_aligon.csv")
silhouettePlot(distMat, dataset$label, "./figure/sil_googleplus_Aligon.pdf")

distMat <- readDistMat("./data/googleplus_aligon_regularization.csv")
silhouettePlot(distMat, dataset$label, "./figure/sil_googleplus_Aligon_regularization.pdf")
library(ggplot2)

comparison <- read.csv(file = "./data/result.csv", header = TRUE)
comparison$dataset <- factor(comparison$dataset,
levels = c("IIT Bombay Dataset",
"UB Exam Dataset",
"PocketData-Google+"))

ggplot(data = comparison, aes(x = metric, y = silhouette, fill = regularization)) +
geom_bar(position="dodge", stat="identity") + facet_grid(~ dataset) +
ylab("Average Silhouette Coefficient") + xlab("Metric") +
theme_bw(base_size = 18) + theme(legend.position = "top") + scale_fill_grey() +
ggsave(filename = "./figure/compare_silhouette.pdf", height = 5)

ggplot(data = comparison, aes(x = metric, y = beta_cv, fill = regularization)) +
geom_bar(position="dodge", stat="identity") + facet_grid(~ dataset) +
ylab("BetaCV") + xlab("Metric") +
theme_bw(base_size = 18) + theme(legend.position = "top") + scale_fill_grey() +
ggsave(filename = "./figure/compare_betacv.pdf", height = 5)

ggplot(data = comparison, aes(x = metric, y = dunn, fill = regularization)) +
geom_bar(position="dodge", stat="identity") + facet_grid(~ dataset) +
ylab("Dunn Index") + xlab("Metric") +
theme_bw(base_size = 18) + theme(legend.position = "top") + scale_fill_grey() +
ggsave(filename = "./figure/compare_dunn.pdf", height = 5)

57 changes: 32 additions & 25 deletions script_figure_3.R
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
# set working directory
#setwd("~/Downloads/EttuBench")

# load two files evaluation.R and utils.R
source(file = "./evaluation.R")
source(file = "./utils.R")

# load supporting libraries
library(ggplot2)

comparison <- read.csv(file = "./data/result.csv", header = TRUE)
comparison$dataset <- factor(comparison$dataset,
levels = c("IIT Bombay Dataset",
"UB Exam Dataset",
"PocketData-Google+"))

ggplot(data = comparison, aes(x = metric, y = silhouette, fill = regularization)) +
geom_bar(position="dodge", stat="identity") + facet_grid(~ dataset) +
ylab("Average Silhouette Coefficient") + xlab("Metric") +
theme_bw(base_size = 18) + theme(legend.position = "top") + scale_fill_grey() +
ggsave(filename = "./figure/compare_silhouette.pdf")

ggplot(data = comparison, aes(x = metric, y = beta_cv, fill = regularization)) +
geom_bar(position="dodge", stat="identity") + facet_grid(~ dataset) +
ylab("Average Silhouette Coefficient") + xlab("Metric") +
theme_bw(base_size = 18) + theme(legend.position = "top") + scale_fill_grey() +
ggsave(filename = "./figure/compare_betacv.pdf")

ggplot(data = comparison, aes(x = metric, y = dunn, fill = regularization)) +
geom_bar(position="dodge", stat="identity") + facet_grid(~ dataset) +
ylab("Average Silhouette Coefficient") + xlab("Metric") +
theme_bw(base_size = 18) + theme(legend.position = "top") + scale_fill_grey() +
ggsave(filename = "./figure/compare_dunn.pdf")
library(cluster)
library(factoextra)
library(RColorBrewer)

dataset <- read.csv(file = "./data/bombay_queries.csv", header = TRUE, sep = "\t")

distMat <- readDistMat("./data/bombay_aligon.csv")
silhouettePlot(distMat, dataset$label, "./figure/sil_bombay_Aligon.pdf")

distMat <- readDistMat("./data/bombay_aligon_regularization.csv")
silhouettePlot(distMat, dataset$label, "./figure/sil_bombay_Aligon_regularization.pdf")

dataset <- read.csv(file = "./data/ub_queries.csv", header = TRUE, sep = "\t")

distMat <- readDistMat("./data/ub_aligon.csv")
silhouettePlot(distMat, dataset$label, "./figure/sil_ub_Aligon.pdf")

distMat <- readDistMat("./data/ub_aligon_regularization.csv")
silhouettePlot(distMat, dataset$label, "./figure/sil_ub_Aligon_regularization.pdf")

dataset <- read.csv(file = "./data/googleplus_queries.csv", header = TRUE, sep = "\t")

distMat <- readDistMat("./data/googleplus_aligon.csv")
silhouettePlot(distMat, dataset$label, "./figure/sil_googleplus_Aligon.pdf")

distMat <- readDistMat("./data/googleplus_aligon_regularization.csv")
silhouettePlot(distMat, dataset$label, "./figure/sil_googleplus_Aligon_regularization.pdf")

2 changes: 1 addition & 1 deletion script_figure_4.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ ggplot(data = comparison, aes(x = Metric, y = Silhouette, fill=Regularization))
ylab("Average Silhouette Coefficient") + xlab("Metric") +
theme_bw(base_size = 14) + theme(legend.position = "top", legend.title = element_blank()) +
scale_fill_brewer(palette = "Dark2") +
ggsave(file = "./figure/module.pdf")
ggsave(file = "./figure/module.pdf")

0 comments on commit ca4445b

Please sign in to comment.