/
init.r
92 lines (69 loc) · 3.13 KB
/
init.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#
# Creator: Pavel Valov (University of Waterloo)
# Date: Jan 2015
#
# Modifiers: Dingyu Yang (Shanghai Dianji University) & Jianmei Guo (East China University of Science and Technology)
# Date: Jun 2016
#
source("monitor.r")
Init <- function() {
# Aggregated function for initializing all parameters
InitMonitorParams()
InitMethodsParams()
InitParamsExperiment()
Monitor("Initialization is complete")
}
InitMonitorParams <- function() {
# Specifies global parameters used by debugging functions
# List specifies debugging levels for functions
# Messages from functions not in the list will not be printed
# Messages from functions that have negative level will not be printed
# Messages with level exceeding specified in the list for function will not
# be printed
funLevels <<- list(# analysis.r
AnalysePredError = 2,
GetPredError = -2,
# data.r
GetSysDataInfo = -2,
# init.r
Init = 2,
# regmodels.r
GetMethodInfo = -2,
Trainer = 2,
TrainCart = 2)
}
InitMethodsParams <- function() {
# Initializes parameter ranges for CART regression method
methodNames <<- list(cart = "CART")
# Initialize CART parameters
# minsplit, minbucket - depend on number of observations
cartNames <- c("minsplit", "minbucket", "maxdepth", "complexity")
cartMinSplit <- c(seq(1,52,1))
cartMinBucket <- round(1/3 * cartMinSplit)
cartmaxdepth <- 30
cartComplexity <- c(0.01, 0.001, 0.0001, 0.00001, 0.000001)
cartSobol <- 1
cart <- list(names = cartNames, minsplit = cartMinSplit, minbucket = cartMinBucket,
maxdepth = cartmaxdepth, complexity = cartComplexity, sobolLen = cartSobol)
methodsParams <<- list(cart = cart)
}
InitParamsExperiment <- function() {
# Initializes parameters relevant to the whole experiment
# input the data name
# systemNames <<- c( "AJStat","Apache","BerkeleyC", "BerkeleyJ","clasp","LLVM","lrzip","SQLite_all4653","x264_158")
# systemNames <<- c( "Hipacc")
systemNames <<- c( "AJStat","Apache","BerkeleyC", "BerkeleyJ","clasp","LLVM","lrzip","SQLite_all4653","x264_158")
experParams <<- list()
# for dataset "Hipacc" , the experParams$sampleSizes applies the number 20 for 20*N
experParams$sampleSizes <<- 9 # default Sizes to generate (1*N, 2*N, ..., 9*N) except "Hipacc" (20N)
experParams$sampleRep <<- 30 # Experiment repetitions ,default 30,
experParams$defalutSampleSizes <<- experParams$sampleSizes # default Sample Sizes
# for ASE 2013 cart method
experParams$previousCartMethod <<- TRUE
# sample method: "holdout","crossvalidation","bootsraping"; default is crossvalidation
experParams$sampleMethod <<- c("holdout","crossvalidation","bootsraping")
experParams$foldNumber <<- 10 # the fold number of cross validation
#parameter optimization search method: "randomsearch","bayesian","gridsearch"
experParams$paraSearchMethod <<- c("gridsearch") #default is "gridsearch"
outputFolder <<- file.path("data", "results")
}