Commit 9eb709c1 authored by Marco De Lucia's avatar Marco De Lucia
Browse files

Added Multiple infrastructure

parent 86e5b708
# Generated by roxygen2: do not edit by hand
export(AME)
export(Act2pH)
export(AddProp)
export(AdvectionPQC)
export(AllowSomeNegativeColumns)
export(AnalyticalLogK)
export(BalanceEquations)
export(BatchPreProc)
export(BatchPreProc_)
export(BestModelCluster)
export(CHT)
export(CheckBalance)
export(CheckColsNumValues)
export(Cols2Fact)
export(CompareTimesteps)
export(Deltas)
export(Distribute)
export(DistributeKin)
export(DistributeKinMatrix)
export(DistributeMatrix)
export(DownSampler)
export(ElementalBalanceMin)
export(ExtractPphases)
export(ExtractSamples)
export(ExtractSpecies)
export(ExtractTotals)
export(FastClust)
export(Filtering)
export(FindAllMinNames)
export(FindAllSpeciesNames)
export(FindAllTotNames)
export(FindLogK)
export(FindPhase)
export(FitSurrogates)
export(FitWithDice)
export(FormulaFromBal)
export(GetModelNames)
export(GetRanges)
export(InitPreProc)
export(Loadata)
export(MAD)
export(MASE)
export(Matplot)
export(MatplotSingle)
export(ModelSelector)
export(MultiRound)
export(NPSC)
export(NumericallyCompareTables)
export(OverrideValueRange)
export(ParseFormula)
export(PlotModsInSample)
export(RPhreeFile)
export(RPhreeWriteInp)
export(RReadOut)
export(RReadOutKin)
export(RSS)
export(RangeTableCreator)
export(ReactTranspBalanceEq)
export(ReactTranspBalanceKin)
export(RecomposeState)
export(ReduceState)
export(Refit)
export(Relcal)
export(RepSol)
export(Reshaping)
export(RunModelList)
export(RunPQC)
export(RunSurrogates)
export(SAD)
export(SDrift)
export(SelectActiveColumns)
export(SelectColsByPredix)
export(SelectMinActiveColumns)
export(SelectPreProc)
export(ShowTopProfiler)
export(SparseChangeCluster)
export(StoichiometricMatrix)
export(SubstractCommonTableCols)
export(SuppressSim)
export(Surrogate)
export(TByElem)
export(Tminus)
export(TrailSpaces)
export(Train)
export(TranspAsPert)
export(WriteModel)
export(WriteModelResiduals)
export(all_mda_mars_impvars)
export(allcoluniquevals)
export(cf)
export(cfa)
export(coltypes)
export(coluniquevals)
export(coluniratio)
export(colwise_RSS)
export(colwise_rescale)
export(createTuneGrids)
export(custom_scaler)
export(dt2v)
export(exc)
export(exc_type)
export(f2i)
export(hb)
export(mae)
export(mda_mars_importance)
export(mrm)
export(msg)
export(na.to.zero)
export(namewithin)
export(nan.to.zero)
export(outminus)
export(pH2Act)
export(paralap)
export(rescaling)
export(roundbycol)
export(rsi)
export(safe_get_cores)
export(seekcoltypeidx)
export(seekcoltypename)
export(sharedvalues)
export(sliding_join)
export(smartround)
export(splitMultiFix)
export(splitMultiKin)
export(start_up)
export(stopmsg)
export(striplast)
export(striplastx)
export(take_top_pct_cols)
export(to.zero)
export(uvc)
export(uvcm)
export(uvt)
export(write_evals)
import(caret)
import(data.table)
import(graphics)
......
This diff is collapsed.
......@@ -3,4 +3,4 @@ demo-kinetics 1D reactive transport with kinetic chemistry
demo-eq-generate-data Generate the training data set from 3 equilibrium simulations
demo-eq-surr-RF Generate the training data set, train randomForest surrogates and perform Reactive Transport simulations using them
demo-kin-surr Generate the training data set, train randomForest surrogates and perform Reactive Transport simulations using them
demo-TrainMultiple Uses the UNSTABLE infrastructure for comparing different trained surrogates
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("PolyMARS", "glmStepAIC", "MARS"),
preprocessing_ind = c(17),
input_data = des,
output_data = res,
seed = 2305,
train_para = TRUE,
run_para = TRUE,
preproc_para = FALSE,
selection_criteria = "MAD",
write_full_residuals=FALSE,
tuner=FALSE,
use_cores=8,
training_samples = 0.95,
write_filepath_prefix=path_dumps
)
a <- SelectedSurrogate(des)
par(mfrow=c(4,2))
for (i in colnames(des)) {
plot(res[,..i][[1]], a[,i],"p",pch=3, main=i,
xlab="Full physics", ylab="Surrogate")
abline(0,1,lty="dashed",col="grey")
}
Supports Markdown
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