Ignore:
Timestamp:
04/30/18 20:24:17 (4 years ago)
Author:
gkronber
Message:

#2886 remove obsolete code in C# program for the evaluation of sentences, switch to NSME as quality measure. Tried plotting functions within clusters in R

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2886_SymRegGrammarEnumeration/ExpressionClustering_R/ClusteringScript.R

    r15903 r15924  
    11library(largeVis)
    22library(ggplot2)
    3 
    4 eval7 <- read.csv2("c:/Users/P24581/Desktop/evaluations_2018-04-11_12-50_TreeSize-7.csv",header = TRUE, sep = ";", dec=",")
    5 eval7_qs <- eval7[,3]
    6 eval7_x <- eval7[,5:105]
    7 lv <- largeVis(eval7_x, dim=2, K = 50, n_trees = 50) # TODO scale?
    8 clusters <- hdbscan(lv, minPts = 3, K=30)
    9 
    10 m <- data.frame(x=t(lv$coords)[,1], y=t(lv$coords)[,2], c=clusters$clusters, q=eval7_qs)
     3library(dplyr)
    114
    125
    13 ggplot(data=m, aes(x=x, y=y)) + geom_point(aes(color=q))
     6
     7sentenceFileName <- "D:/heal/documents/trunk/Publications/2018/GPTP/data/evaluations_allSentences_2018-04-13_16-40_TreeSize-7_1d.csv.gz";
     8evalData <- read.csv(sentenceFileName,header = TRUE, sep = ";", dec=",");
     9qualities <- evalData$R2.keijzer4;
     10outputs <- evalData[,6:105];
     11
     12lv <- largeVis(outputs, dim=2, K = 50, n_trees = 50) # TODO scale?
     13clusters <- hdbscan(lv, minPts = 3, K=50);
     14
     15
     16
     17m <- data.frame(x=t(lv$coords)[,1], y=t(lv$coords)[,2], c=clusters$clusters, q=qualities, outputs)
     18# plot mapped points
     19ggplot(data=m, aes(x=x, y=y)) + geom_point(aes(color=c))  + theme(legend.position = "none") ;
     20
     21cluster_n <- dplyr::filter(m, c==5);
     22cluster_evals <- data.frame(x=seq(1,100,1), t(cluster_n[,5:104]))
     23evals_cluster_n <- tidyr::gather(cluster_evals,"f", "fx", 2:ncol(cluster_evals))
     24
     25p <- ggplot(evals_cluster_n, aes(x=x, y=fx,color=f)) + geom_line();
     26p
     27
Note: See TracChangeset for help on using the changeset viewer.