diff options
-rw-r--r-- | run.R | 13 | ||||
-rw-r--r-- | util.R | 15 |
2 files changed, 16 insertions, 12 deletions
@@ -8,6 +8,7 @@ require(mp) require(Rtsne) source("measures.R") +source("util.R") # Performs automated silhouette improvement manipulation, using a method # inspired by Schaefer et al. (2013). @@ -76,18 +77,6 @@ scale.Ys <- function(Ys) { Ys } -# Creates a directory at given path, optionally logging the action. -# If it already exists, the directory is not created. -dir.create.safe <- function(path, log=T) { - if (!dir.exists(path)) { - if (log) { - loginfo("Creating directory: %s", path) - } - - dir.create(path) - } -} - # Generates samples (one sample per iteration) and performs automated # manipulation for all measures on each sample. run.manipulation <- function(X, Dx, labels, k, ds, n.iter, output.dir) { @@ -0,0 +1,15 @@ +# util.R +# +# Assorted utilities. + +# Creates a directory at given path, optionally logging the action. +# If it already exists, the directory is not created. +dir.create.safe <- function(path, log=T) { + if (!dir.exists(path)) { + if (log) { + loginfo("Creating directory: %s", path) + } + + dir.create(path) + } +} |