this repo has no description
at main 43 lines 728 B view raw
1library(ggplot2) 2library(reshape2) 3library(viridis) 4 5data <- read.csv("data/synonym_thresholds.csv") 6mat <- data.frame( 7 data $ min, 8 data $ q1, 9 data $ median, 10 data $ mean, 11 data $ q3, 12 data $ max 13) |> as.matrix() 14 15rownames(mat) <- list( 16 "Google News", 17 "GloVe 300-D", 18 "GloVe 200-D", 19 "GloVe 100-D", 20 "GloVe 50-D" 21) |> as.character() 22 23colnames(mat) <- list( 24 "Minimum", 25 "First Quartile", 26 "Median", 27 "Mean", 28 "Third Quartile", 29 "Max" 30) 31 32ld <- melt(mat) 33ld <- ld[ld $ value != 0,] 34 35pdf("synonyms.pdf") 36ggplot(ld, aes(x = Var2, y = Var1)) + 37 geom_raster(aes(fill = value)) + 38 scale_fill_viridis_c() + 39 geom_text(aes(label = value)) + 40 labs(x = "Quartiles", y = "Models") + 41 theme_light() + 42 theme(aspect.ratio = 1) 43dev.off()