-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_TRAIN_NONTREES.R
50 lines (40 loc) · 1.48 KB
/
_TRAIN_NONTREES.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
print("############################################################")
print("Train GLMNET")
#####################################################################
source("CV_GLMNET.R")
GLMNET<-CV_GLMNET(x=x,
y=y,
K=K,
alpha=GLMNET_alpha,
standardize=GLMNET_standardize,
nb_cores=nb_cores,
seed=seed)
print(cor(y,GLMNET$yhatV,method="pearson"))
print("############################################################")
print("TRAIN SVM with linear kernel")
#####################################################################
source("CV_SVM_lin.R")
SVM_lin<-tune_SVM_lin(
x=x,y=y,K=K,
cost_i=SVM_lin_cost_i,
cost_var=SVM_lin_cost_var,
step_max=SVM_lin_step_max,
nb_cores=nb_cores,
seed=seed)
print("############################################################")
print("TRAIN SVM with radial kernel")
#####################################################################
source("CV_SVM_rad.R")
SVM_rad<-tune_SVM_rad(
x=x,y=y,K=K,
cost_i=SVM_rad_cost_i,gamma_i=SVM_rad_gamma_i,
cost_var=SVM_rad_cost_var,gamma_var=SVM_rad_gamma_var,
step_max=SVM_rad_step_max,
nb_cores=nb_cores,
seed=seed)
print("############################################################")
print("Save")
#####################################################################
save(seed,GLMNET,SVM_lin,SVM_rad,
file=paste("Working_files/",Version,"_",item,"_NonTrees_w",DTM_name,".RData",sep=""))
rm(list=ls())