1 | # find nearest neighbors for GP indiviuals
|
---|
2 |
|
---|
3 | library(ggplot2);
|
---|
4 |
|
---|
5 | gp_log <- read.csv2("C:/Users/P24581/filebox/GPTP 2018/symbreg-models-13.05.2018-1418.csv",header = FALSE,sep='\t',dec=',');
|
---|
6 | idx <- seq(1:nrow(gp_log));
|
---|
7 | # check popSize in gp_log
|
---|
8 | gp_log[seq(1,34000,500),1]
|
---|
9 | popSize <- 500;
|
---|
10 |
|
---|
11 | # check qualities
|
---|
12 | # ggplot(gp_log, aes(x=idx,y=gp_log$V1)) + geom_line();
|
---|
13 |
|
---|
14 | # generations <- seq(1,34000/popSize,1);
|
---|
15 | generations <- seq(1,15,1);
|
---|
16 | numClusters <- max(m$c);
|
---|
17 |
|
---|
18 | gp_evals <- gp_log[,seq(3,202,2)];
|
---|
19 | all_evals <- m[,6:105];
|
---|
20 | for(gen_i in generations) {
|
---|
21 | #gen_i <- 15;
|
---|
22 | selectedRows <- seq((gen_i - 1)*popSize + 1, gen_i * popSize,1);
|
---|
23 | min(selectedRows)
|
---|
24 | max(selectedRows)
|
---|
25 | xcorrel <- cor(t(all_evals[,]), t(gp_evals[selectedRows,]))^2
|
---|
26 | mapped_gp_log <- m[max.col(t(xcorrel)), 1:5]
|
---|
27 | #check
|
---|
28 | #cor(t(all_evals[128082,]), t(gp_evals[2,]))^2
|
---|
29 | #max(cor(t(all_evals[,]), t(gp_evals[2,]))^2)
|
---|
30 | ggplot(mapped_gp_log, aes(x=x, y=y)) + xlim(-75,75) + ylim(-75,75) + geom_point();
|
---|
31 | ggsave(paste("scatter",gen_i,".png"))
|
---|
32 |
|
---|
33 | ggplot(mapped_gp_log, aes(x=c)) +xlim(0,numClusters+1) + geom_histogram(binwidth = 1);
|
---|
34 | ggsave(paste("cluster_freq",gen_i,".png"))
|
---|
35 | }
|
---|