source:
branches/2886_SymRegGrammarEnumeration/ExpressionClustering_R/ClusteringScript.R
@
15924
Last change on this file since 15924 was 15924, checked in by gkronber, 6 years ago | |
---|---|
File size: 941 bytes |
Rev | Line | |
---|---|---|
[15903] | 1 | library(largeVis) |
2 | library(ggplot2) | |
[15924] | 3 | library(dplyr) |
[15903] | 4 | |
5 | ||
6 | ||
[15924] | 7 | sentenceFileName <- "D:/heal/documents/trunk/Publications/2018/GPTP/data/evaluations_allSentences_2018-04-13_16-40_TreeSize-7_1d.csv.gz"; |
8 | evalData <- read.csv(sentenceFileName,header = TRUE, sep = ";", dec=","); | |
9 | qualities <- evalData$R2.keijzer4; | |
10 | outputs <- evalData[,6:105]; | |
[15903] | 11 | |
[15924] | 12 | lv <- largeVis(outputs, dim=2, K = 50, n_trees = 50) # TODO scale? |
13 | clusters <- hdbscan(lv, minPts = 3, K=50); | |
14 | ||
15 | ||
16 | ||
17 | m <- data.frame(x=t(lv$coords)[,1], y=t(lv$coords)[,2], c=clusters$clusters, q=qualities, outputs) | |
18 | # plot mapped points | |
19 | ggplot(data=m, aes(x=x, y=y)) + geom_point(aes(color=c)) + theme(legend.position = "none") ; | |
20 | ||
21 | cluster_n <- dplyr::filter(m, c==5); | |
22 | cluster_evals <- data.frame(x=seq(1,100,1), t(cluster_n[,5:104])) | |
23 | evals_cluster_n <- tidyr::gather(cluster_evals,"f", "fx", 2:ncol(cluster_evals)) | |
24 | ||
25 | p <- ggplot(evals_cluster_n, aes(x=x, y=fx,color=f)) + geom_line(); | |
26 | p | |
27 |
Note: See TracBrowser
for help on using the repository browser.