-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-all-lasso-stand.R
42 lines (35 loc) · 1.52 KB
/
run-all-lasso-stand.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
# do analysis for different data sets and combinations
getwd()
setwd("Repos/MA-climate/")
source("code/R/helper-functions.R")
library(raster)
library(ggplot2)
library(glmnet)
save_to <- "test-lasso-stand"
sst_cv_path <- "data/processed/sst_cv.rds"
precip_cv_path <- "data/processed/precip_cv.rds"
standardize_features <- FALSE
standardize_response <- TRUE
sst_eval_path <- "data/processed/sst_eval.rds"
precip_eval_path <- "data/processed/precip_eval.rds"
center_response <- FALSE
diff_n <- FALSE
sst_cv <- readRDS("data/processed/sst_cv.rds")
precip_cv <- readRDS("data/processed/precip_cv.rds")
test_lasso <- cv_for_ts(sst = sst_cv, precip = precip_cv, nfold = 5,
size_train = 60, size_test = 14,
save_folder = save_to,
model = "lasso",
include_ts_vars=FALSE,
stand=FALSE, diff_features=FALSE,
des_features=FALSE,
center_response=FALSE,
standardize_features = standardize_features)
err_bar_plot <- readRDS(paste0("results/CV-lasso/",save_to,"/err-mat-plots/err-bars-plot.rds"))
ll <- get_l_1se_high_low(err_bar_plot)
fit_eval_full_lasso(save_to, sst_cv_path, precip_cv_path,
sst_eval_path, precip_eval_path,
standardize_response = standardize_response,
center_response = center_response,
standardize_features = standardize_features,
diff_n = diff_n)