Select Git revision
CONTRIBUTING.rst
-
Daniel Scheffler authored
updated __version__ and __versionalias__
Daniel Scheffler authoredupdated __version__ and __versionalias__
After you've reviewed these contribution guidelines, you'll be all set to
contribute to this project.
Surr_Train.R 94.16 KiB
## Functions for dealing with surrogate simulations
### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2018
### Janis Jatnieks, janisj@gfz-potsdam.de, jatnieks@janis.es
### Time-stamp: "Last modified 2018-05-09 01:07:22 delucia"
### Licence: LGPL version 2.1
## resolve dependencies automatically
## put neccessary packages here, they will be checked, loaded and autoinstalled if neccessary
##' @export
start_up <- function(session_path=FALSE, ## to disable set to a non-string
list.of.packages = c(## infrastructure and data manipulation
"zoo","plyr","sqldf","dtplyr","foreach",
"data.table",
## multi-method learning meta-packages
"DiceEval","caret", #,"caretEnsemble"
## actual learning method packages
"mda","gam","polspline","rpart","MASS",
"elasticnet","e1071","ipred",
"deepnet","kernlab","pls","fastICA","lars",
"monomvn","RSNNS","qrnn",
"party","quantregForest","arm","brnn",
"lattice","ggplot2","plotrix", ## viz prototyping
## testing
"cluster","stringr","gtools", #"ftsa",
"amap"),
install=TRUE,
use_cores=4)
{
gc()
msg("loading doParallel")
list.of.packages = c(list.of.packages,"doParallel")
## load session data first
## if (class(session_path)[1]=="character" & file.exists(session_path) ) {
## msg("Loading...",session_path)
## load(session_path, .GlobalEnv)
## msg(" OK")
## }
## loading the right data is important!
## check install and load neccessary packages
msg("Checking for required packages...")
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) {
cat("Need to install these packages:",new.packages,"\n")
if (install) {
libpath <- readline(prompt="Please specify the absolute path where the packages will be installed (e.g., '~/Rdevel'): \n")
cat(" Afterwards, remember to store this path somewhere for R to find it again, such as R_LIBS_USER='~/Rdevel' in ~/.Renviron\n")
install.packages(new.packages, lib=libpath)
}
} else msg("Package checks OK!")
loadsuccess <- lapply(list.of.packages, require, character.only=TRUE)
msg("Registering parallelization with ", use_cores, "cores")
registerDoParallel( use_cores ) ## set up parallelization
### MDL: some global definitions
## we use this to swich calls between Dice and caret or direct calls
## to others
DiceMethods <<- c('Linear','Additive','MARS','MARS3',
'PolyMARS','PolyMARS3','StepLinear','PolyMARS_GCV1')
## I enumerate them here so that no large text blocks
## would repeat in pre- and post- processing code
specific_preprocessing_methods <<- c(
"(0,1) scaled rolling deltas", ## 1