Commit 3cf65634 authored by Marco De Lucia's avatar Marco De Lucia
Browse files

Removed demo/demo-eq-TrainMultiple.R

parent 88a879aa
......@@ -3,5 +3,4 @@ demo-kinetics 1D reactive transport with kinetic chemistry, full-physics
demo-eq-generate-data Generate the training data set from 3 equilibrium simulations
demo-eq-surr-RF Generate the training data set for equilibrium simulations, train randomForest surrogates and perform Reactive Transport simulations using them
demo-kin-surr-RF Generate the training data set for kinetic simulations, train randomForest surrogates and perform Reactive Transport simulations using them
demo-eq-TrainMultiple Uses the UNSTABLE infrastructure for comparing different trained surrogates
demo-gmd2020-445 Pointer to the actual gitlab repository for the code
des_path <- system.file("extdata", "demo_equilibrium_design.csv", package="RedModRphree")
res_path <- system.file("extdata", "demo_equilibrium_result.csv", package="RedModRphree")
des <- data.table::fread(des_path)
res <- data.table::fread(res_path)
## We create a directory where to dump the created data structures
path_dumps <- "TrainedModels/"
## if it does not exist we create it
if (!dir.exists(path_dumps)) dir.create(path_dumps, showWarnings = FALSE)
Train(c("parRF", "leaps", "MARS"),
preprocessing_ind = c(17),
input_data = des,
output_data = res,
seed = 2305,
train_para = TRUE,
run_para = TRUE,
allow_neg_cols="pe",
preproc_para = FALSE,
selection_criteria = "MAD",
write_full_residuals=FALSE,
tuner=FALSE,
use_cores=4,
training_samples = 0.85,
session_path=FALSE,
write_filepath_prefix=path_dumps
)
a <- SelectedSurrogate(des)
SelectedMethods <- GetModelNames(model_list)
names(SelectedMethods) <- colnames(res)
par(mfrow=c(4,2))
for (i in colnames(des)) {
plot(res[,..i][[1]], a[,i],"p",pch=3, main=paste(i,SelectedMethods[i], sep=", "),
xlab="Full physics", ylab="Surrogate")
abline(0,1,lty="dashed",col="grey")
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment