Commit 6caf13b1 authored by Janis Jatnieks's avatar Janis Jatnieks
Browse files

Update Surr_Train.R for safer Residuals export + export of error indexes.

parent e6aba3c1
......@@ -1307,26 +1307,24 @@ 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)
## write names that mean something, so that you know what errors you are looking at
colnames(all_res) <- paste ( dt2v( Sperf, "output" ),
# for col length safety, extract first the vectors from Residuals list, then data.table
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(best_res) <- paste ( dt2v( Sperf, "output" ),
dt2v( Sperf, "method" ),
dt2v( Sperf, "preprocessing" ),
sep="_" )
best_res <<- subset(all_res,select=perftop[,"model_id"])
sep="_" )[ perftop[,"model_id"] ] # use only the names needed
## 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
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
......
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