Commit cc1078b5 authored by Janis Jatnieks's avatar Janis Jatnieks
Browse files

Update Surrogate_playground.R to write out Residuals and indexes better

parent 9005c836
......@@ -744,21 +744,22 @@ WriteModelResiduals <- function(write_filepath_prefix, training_samples, seed) {
training_samples),
collapse="_"),collapse="")
}
# write out raw residuals for the best model combination
all_res <<- as.data.table(Residuals)
best_res <<- as.data.table(Residuals[ perftop[,"model_id"] ])
# write names that mean something, so that you know what errors you are looking at
colnames(all_res) <- paste ( dt2v( Sperf, "output" ),
colnames(best_res) <- paste ( dt2v( Sperf, "output" ),
dt2v( Sperf, "method" ),
dt2v( Sperf, "preprocessing" ),
sep="_" )
sep="_" )[ perftop[,"model_id"] ] # use only the names needed
best_res <<- subset(all_res,select=perftop[,"model_id"])
# write all for testing and manual overview
#fwrite( all_res, "debug/all_residuals.csv" )
# write out only for those that have non-zero columns
fwrite( SelectActiveColumns(best_res), file = paste0(ensemble_name,"_residuals_best.csv" ))
# residuals are errors on validation data set - created as inverse from these indexes
fwrite( as.data.table(inds), file = paste0(ensemble_name,"_training_idxs.csv" ) )
fwrite( as.data.table(inds), file = paste0(ensemble_name,"_train_inds.csv" ) )
# err index export
err_inds = as.data.table( seq(nrow(Fout))[-inds] )
colnames( err_inds ) <- "err_inds"
fwrite( as.data.table(err_inds), file = paste0(ensemble_name,"_err_inds.csv" ) )
}
# once we have screened all the desired possibilities, we
# can try to select the best combination of surrogate models and their
......
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