generate_projections.R 629 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env Rscript
  2. library(cluster)
  3. library(mp)
  4. data <- read.csv2("../app/data/proj/projection_data.csv")
  5. m <- daisy(data)
  6. #Generate projections with geography information
  7. tsne_proj <- tSNE(m)
  8. lamp_proj <- lamp(m)
  9. saveRDS(tsne_proj, "../app/data/rds/proj_with_geography_tsne.rds")
  10. saveRDS(lamp_proj, "../app/data/rds/proj_with_geography_lamp.rds")
  11. #Generate projections without geography information
  12. data <- data[-c(1,2,3,4,5,6)]
  13. m <- daisy(data)
  14. tsne_proj <- tSNE(m)
  15. lamp_proj <- lamp(m)
  16. saveRDS(tsne_proj, "../app/data/rds/proj_no_geography_tsne.rds")
  17. saveRDS(lamp_proj, "../app/data/rds/proj_no_geography_lamp.rds")