Skip to content
Snippets Groups Projects
Select Git revision
  • 71b989b145677a202b956cc1b60fac540604bf8b
  • main default protected
  • multi-gitter-gfz-name-repl
  • multi-gitter-branch
  • enhancement/add_sqa
  • 17-initially-set-up-sqa
  • bugfix/fix_warp_ndarray_crash
  • bugfix/fix_warp_ndarray
  • feature/add_localCS_compatibility
  • v0.23.1
  • v0.23.0
  • v0.22.3
  • v0.22.2
  • v0.22.1
  • v0.22.0
  • v0.21.1
  • v0.21.0
  • v0.20.2
  • v0.20.1
  • v0.20.0
  • v0.19.1
  • v0.19.0
  • v0.18.1
  • v0.18.0
  • v0.17.9
  • v0.17.8
  • v0.17.7
  • v0.17.6
  • v0.17.5
29 results

HISTORY.rst

Blame
  • To find the state of this project's repository at the time of any of these versions, check out the tags.
    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