Commit 9dfbba0d authored by joerg.buescher's avatar joerg.buescher
Browse files

bugfix in initial training

parent 45c264d6
......@@ -352,9 +352,11 @@ if (prm$verbose >= 1) {
for (im in 1:prm$nmet) {
mpos <- which(oldcheck[1, ] == metab[[im]]$name)
if (length(mpos) == 1) {
if ( (abs(as.numeric(oldcheck[spos, mpos+1]) - prm$unirt[pstartmat[id ,im]] ) < 0.1) &&
(abs(as.numeric(oldcheck[spos, mpos+2]) - prm$unirt[pendmat[id ,im]] ) < 0.1) ) {
nowscore[id,im] <- oldcheck[spos, mpos]
if (!any(is.na(c(pstartmat[id ,im],pendmat[id ,im] )))) {
if ( (abs(as.numeric(oldcheck[spos, mpos+1]) - prm$unirt[pstartmat[id ,im]] ) < 0.1) &&
(abs(as.numeric(oldcheck[spos, mpos+2]) - prm$unirt[pendmat[id ,im]] ) < 0.1) ) {
nowscore[id,im] <- oldcheck[spos, mpos]
}
}
}
}
......
......@@ -85,11 +85,6 @@ process_batch <- function(nowfolder = "", parameters = list(), return_msd=FALSE)
troubleshootpath <- file.path(prm$batchdir, 'troubleshoot.RData')
if (prm$runninglocal && (prm$ml_type == 'mltrain_prepare') && file.exists(troubleshootpath)) {
load(file = troubleshootpath) # partially processed data from initial training
prm$log_con <- file(file.path(prm$batchdir, "R_messages.log"),open="a")
load(file = prm$model_path) # 1. model to detect best peak in MRM
prm$model <- model_pcand
prm$train_preprocessing <- train_preprocessing_pcand
prm$median_values <- model_median_values
# update prm from argument parameters again
paranames <- names(parameters)
if (!is.null(paranames)) {
......@@ -98,6 +93,11 @@ process_batch <- function(nowfolder = "", parameters = list(), return_msd=FALSE)
}
}
prm$log_con <- file(file.path(prm$batchdir, "R_messages.log"),open="a")
load(file = prm$model_path) # 1. model to detect best peak in MRM
prm$model <- model_pcand
prm$train_preprocessing <- train_preprocessing_pcand
prm$median_values <- model_median_values
} else {
# load random forest models and add to parameter list
......
......@@ -166,9 +166,9 @@ train_model <- function(model_type, ml_type = 'rf', base_folder = '.', data_sets
model = caret::train(y ~ .,
data=train_data,
method='nnet',
maxit = 1000,
tuneLength=10,
metric="ROC",
ntree=500,
nodesize = 5, # 1 as an alternative
trControl = fitControl)
......
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