-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdescriptive-model.r
More file actions
43 lines (29 loc) · 913 Bytes
/
descriptive-model.r
File metadata and controls
43 lines (29 loc) · 913 Bytes
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
load("data/tsl_uni_90_mix.rdata")
load("best_estimator.rdata")
load("series_length.rdata")
load("stationarity_tsdl.rdata")
source("src/dynamics.r")
library(rpart)
library(rattle)
library(party)
library(ranger)
Z <- lapply(ts_list, function(x) dynamics_ts(tail(x,1000)))
names(Z) <- paste0("TS_", seq_along(Z))
Z <- do.call(rbind, Z)
Z$estimator <- best_estimator
#save(Z, file = "metadata.rdata")
#load("metadata.rdata")
colnames(Z) <- c(
"Trend","Qt05","Qt95","IQR","Skewness","Kurtosis",
"MLE","Hurst","N","SerialCorr","estimator"
)
Z$Stationarity <- as.character(as.integer(is_stationary_2ensemble))
Z$estimator <- as.factor(ifelse(grepl("CV",Z$estimator), "CVAL","OOS"))
library(rpart)
library(rpart.plot)
m <- rpart(estimator ~., Z,
control = list(cp=.028))
rpart.plot(m,type=2, extra=2,
clip.right.labs = F,
fallen.leaves=F,cex=0.8,
under = F)