Commit 0b95f336 authored by Edi Prifti's avatar Edi Prifti

- fix small bugs due to var name changes for the doc

parent 2c36f8bd
......@@ -21,7 +21,7 @@
#' @param warnings: Print out warnings when runnig (default:FALSE).
#' @param debug: print debug information (default:FALSE)
#' @param print_ind_method: One of c("short","graphical") indicates how to print a model and subsequently a population during the run (default:"short").
#' @param parallelize_folds: parallelize folds when cross-validating (default:TRUE)
#' @param parallelize.folds: parallelize folds when cross-validating (default:TRUE)
#' @param nCores: the number of cores to execute the program. If nCores=1 than the program runs in a non parallel mode
#' @param seed: the seed to be used for reproductibility. If seed=NULL than it is not taken into account (default:NULL).
#' @param experiment.id: The id of the experiment that is to be used in the plots and comparitive analyses (default is the learner's name, when not specified)
......@@ -44,7 +44,7 @@ metal <- function(sparsity = 1:10, max.nb.features = 1000,
objective = "auc", k_penalty = 0, evalToFit = "accuracy_", estimate_coefs = FALSE, intercept = "NULL", testAllSigns = FALSE,
# output options
plot = FALSE, verbose = TRUE, warnings = FALSE, debug = FALSE, print_ind_method = "short",
parallelize_folds = TRUE,
parallelize.folds = TRUE,
# computing options
nCores = 10, seed = "NULL", #maxTime = Inf,
# experiment options
......@@ -75,7 +75,7 @@ metal <- function(sparsity = 1:10, max.nb.features = 1000,
# Computing options
clf$params$nCores <- nCores # parallel computing
clf$params$parallel <- nCores > 1 # parallel computing
clf$params$parallelize_folds <- parallelize_folds
clf$params$parallelize.folds <- parallelize.folds
clf$params$parallel.local <- FALSE
clf$params$seed <- seed # fix the seed to be able to reproduce results
......@@ -166,7 +166,7 @@ metal_fit <- function(X, y, clf)
if(clf$params$verbose) printClassifier(obj = clf)
# parallel switch
#parfold <- FALSE
# if(!clf$params$parallelize_folds & clf$params$parallel)
# if(!clf$params$parallelize.folds & clf$params$parallel)
# {
# parfold <- TRUE
# }
......@@ -198,7 +198,7 @@ metal_fit <- function(X, y, clf)
{
g.clf <- list.clfs[[i]]
g.clf$params$cluster <- clf$params$cluster
g.clf$params$parallelize_folds <- FALSE
g.clf$params$parallelize.folds <- FALSE
# initiate the current sparsity
g.clf$params$current_seed <- clf$params$current_seed
g.clf$params$objective <- clf$params$objective
......
......@@ -35,7 +35,7 @@
#' @param lfolds: The folds to be used for the cross-validation
#' @param nfolds: The number of folds to use in the cross-validation. If lfolds
#' are not specified this option allows to set them up (default:10)
#' @param parallelize_folds: Switch setting the parallelization mode based on
#' @param parallelize.folds: Switch setting the parallelization mode based on
#' cross-validation folds and nothing else in the algorithm (default:TRUE).
#' This is much more efficient.
#' @param compute.importance: The importance of variables in the learning process
......@@ -56,7 +56,7 @@ fit <- function(X,
cross.validate = FALSE,
lfolds = NULL,
nfolds = 10,
parallelize_folds = TRUE,
parallelize.folds = TRUE,
compute.importance = TRUE,
return.all = FALSE,
log.file = "parallel.log",
......@@ -259,8 +259,8 @@ fit <- function(X,
cross.validate = FALSE
}
# set the parallelize_folds parameter. If no crossval than it is deactivated
clf$params$parallelize_folds <- parallelize_folds & cross.validate & clf$params$parallel
# set the parallelize.folds parameter. If no crossval than it is deactivated
clf$params$parallelize.folds <- parallelize.folds & cross.validate & clf$params$parallel
# add a parallel.local parameter if we wish to speed out some local steps
clf$params$parallel.local <- FALSE
......@@ -273,7 +273,7 @@ fit <- function(X,
# during the launch this will be a sleeping thread so no harm, if not it
# will allow to run faster as we won't forget to increment it
registerDoSNOW(clf$params$cluster <- makeCluster(clf$params$nCores + 1, type = "SOCK", outfile = log.file))
if(!clf$params$parallelize_folds) # if folds are not parallelized
if(!clf$params$parallelize.folds) # if folds are not parallelized
{
clf$params$parallel.local <- TRUE # switch the local parallel to TRUE
}
......@@ -709,7 +709,7 @@ runCrossval <- function(X, y, clf, lfolds = NULL, nfolds = 10, return.all = FALS
res.crossval$scores$generalization.cor <- res.crossval$scores$empirical.auc # cor
# for each fold compute the best models
if(clf$params$parallelize_folds)
if(clf$params$parallelize.folds)
{
cat("... Starting CV in parallel\n")
# execute each crossVal in //
......@@ -844,7 +844,7 @@ runCrossval <- function(X, y, clf, lfolds = NULL, nfolds = 10, return.all = FALS
) # end try
} # end else debug
} # end of folds loop (for)
} # end else parallelize_folds
} # end else parallelize.folds
if(clf$params$verbose) cat("... Cross validation finished\n")
......
......@@ -48,6 +48,7 @@
#' @param popSaveFile: (??)
#' @param seed: the seed to be used for reproductibility. If seed=NULL than it is not taken into account (default:NULL).
#' @param nCores: the number of CPUs to run the programm in parallel
#' @param plot: Plot graphics indicating the evolution of the simulation (default:FALSE)
#' @param verbose: print out information on the progress of the algorithm (default:TRUE)
#' @param warnings: Print out warnings when runnig (default:FALSE).
#' @param debug: print out information on the progress of the algorithm (default:FALSE)
......@@ -88,12 +89,14 @@ sota.rf <- function(sparsity = c(1:30), # when sparsityis null it means that we
seed = "NULL",
nCores = 4,
verbose = TRUE,
plot = FALSE,
warnings = FALSE,
debug = FALSE,
print_ind_method = "short",
experiment.id = NULL,
experiment.description = NULL,
experiment.save = "nothing") {
experiment.save = "nothing")
{
clf <- list() # create a classifier object
clf$learner <- "sota.rf" # name of the method
......@@ -121,6 +124,7 @@ sota.rf <- function(sparsity = c(1:30), # when sparsityis null it means that we
clf$params$norm.votes <- norm.votes # If TRUE (default), the final result of votes are expressed as fractions. If FALSE, raw vote counts are returned
clf$params$do.trace <- do.trace # If set to TRUE, give a more verbose output as randomForest is run
clf$params$plot <- plot
clf$params$verbose <- verbose
clf$params$warnings <- warnings # print out warnings
clf$params$debug <- debug # print out logs.
......
......@@ -48,6 +48,7 @@
#' @param popSaveFile: (??)
#' @param seed: the seed to be used for reproductibility. If seed=NULL than it is not taken into account (default:NULL).
#' @param nCores: the number of CPUs to run the program in parallel
#' @param plot: Plot graphics indicating the evolution of the simulation (default:FALSE)
#' @param verbose: print out information on the progress of the algorithm (default:TRUE)
#' @param warnings: Print out warnings when runnig (default:FALSE).
#' @param debug: print out information on the progress of the algorithm (default:FALSE)
......@@ -83,12 +84,14 @@ sota.svm <- function(sparsity = c(1:30), # when sparsity == 0 it means that we c
seed = "NULL",
nCores = 4,
verbose = TRUE,
plot = FALSE,
warnings = FALSE,
debug = FALSE,
print_ind_method = "short",
experiment.id = NULL,
experiment.description = NULL,
experiment.save = "nothing") {
experiment.save = "nothing")
{
clf <- list() # create a classifier object
clf$learner <- "sota.svm" # name of the method
......@@ -129,7 +132,8 @@ sota.svm <- function(sparsity = c(1:30), # when sparsity == 0 it means that we c
clf$params$seed <- seed
clf$params$nCores <- nCores # parallel computing
clf$params$parallel <- nCores > 1 # parallel computing
clf$params$verbose <- verbose # print out logs.
clf$params$plot <- plot # plot out logs.
clf$params$verbose <- verbose # print out graphics
clf$params$warnings <- warnings # print out warnings
clf$params$debug <- debug # print out logs.
clf$params$print_ind_method <- print_ind_method # method to print individual
......
......@@ -226,7 +226,7 @@ LPO_best_models <- function(X, y, clf, p=1, lfolds=NULL, return.all=FALSE,nk=20)
#cl <- makeCluster(clf$params$nCores, type = "FORK",outfile='LOG.TXT')
#registerDoParallel(cl)
clf$params$cluster <- cl
if(clf$params$parallelize_folds)
if(clf$params$parallelize.folds)
{
print("Starting cross validation in parallel")
# execute each crossVal in //
......@@ -270,7 +270,7 @@ LPO_best_models <- function(X, y, clf, p=1, lfolds=NULL, return.all=FALSE,nk=20)
res.all[[i]] <- runClassifier(X = x_train, y = y_train, clf = clf)
} # end of folds loop (for)
} # end else parallelize_folds
} # end else parallelize.folds
# Dispatch the results in the custom output structure
......
......@@ -44,7 +44,7 @@
#' @param debug: print debug information (default:FALSE)
#' @param print_ind_method: One of c("short","graphical") indicates how to print a model and subsequently a population during the run (default:"short").
#' @param nCores: the number of cores to execute the program. If nCores=1 than the program runs in a non parallel mode
#' @param parallelize_folds: parallelize folds when cross-validating (default:TRUE)
#' @param parallelize.folds: parallelize folds when cross-validating (default:TRUE)
#' @param seed: the seed to be used for reproductibility. If seed=NULL than it is not taken into account (default:NULL).
#### TODO check
#' @param experiment.id: The id of the experiment that is to be used in the plots and comparitive analyses (default is the learner's name, when not specified)
......@@ -70,7 +70,7 @@ terBeam <- function(sparsity = 1:5, max.nb.features = 1000,
# evaluation options
objective = "auc", k_penalty=0, evalToFit = 'auc_', estimate_coefs=FALSE, intercept = "NULL", testAllSigns = FALSE,
# output options
plot = FALSE, verbose = TRUE, warnings = FALSE, debug = FALSE, print_ind_method = "short", parallelize_folds = TRUE,
plot = FALSE, verbose = TRUE, warnings = FALSE, debug = FALSE, print_ind_method = "short", parallelize.folds = TRUE,
# computing options
nCores = 4, seed = "NULL", #maxTime = Inf,
# experiment options
......@@ -106,7 +106,7 @@ terBeam <- function(sparsity = 1:5, max.nb.features = 1000,
# Computing options
clf$params$nCores <- nCores # parallel computing
clf$params$parallel <- nCores > 1 # parallel computing
clf$params$parallelize_folds <- parallelize_folds
clf$params$parallelize.folds <- parallelize.folds
clf$params$parallel.local <- FALSE
clf$params$seed <- seed # fix the seed to be able to reproduce results
......
......@@ -46,7 +46,7 @@
#' @param warnings: Print out warnings when runnig (default:FALSE).
#' @param debug: print out debug infotmation when activated (default: FALSE)
#' @param print_ind_method: One of c("short","graphical") indicates how to print a model and subsequently a population during the run (default:"short").
#' @param parallelize_folds: parallelize folds when cross-validating (default:TRUE)
#' @param parallelize.folds: parallelize folds when cross-validating (default:TRUE)
#' @param nCores: the number of cores to execute the program. If nCores=1 than the program runs in a non parallel mode
#' @param seed: the seed to be used for reproductibility. If seed=NULL than it is not taken into account (default:NULL).
#### TODO check
......@@ -68,7 +68,7 @@ terda <- function(sparsity = 5, nIterations = 5, max.nb.features = 1000, kBest =
# population options
popSaveFile = "NULL", final.pop.perc = 100, alpha = 0.5,
# output options
plot = FALSE, verbose = TRUE, warnings = FALSE, debug = FALSE, print_ind_method = "short", parallelize_folds = TRUE,
plot = FALSE, verbose = TRUE, warnings = FALSE, debug = FALSE, print_ind_method = "short", parallelize.folds = TRUE,
# computing options
nCores = 4, seed = "NULL", #maxTime = Inf,
# experiment options
......@@ -107,7 +107,7 @@ terda <- function(sparsity = 5, nIterations = 5, max.nb.features = 1000, kBest =
# Computing options
clf$params$nCores <- nCores # parallel computing
clf$params$parallel <- (nCores > 1) # parallel computing
clf$params$parallelize_folds <- parallelize_folds
clf$params$parallelize.folds <- parallelize.folds
clf$params$parallel.local <- FALSE
clf$params$seed <- seed # fix the seed to be able to reproduce results
......
......@@ -52,7 +52,7 @@
#' @param warnings: Print out warnings when runnig (default:FALSE).
#' @param debug: print debug information (default:FALSE)
#' @param print_ind_method: One of c("short","graphical") indicates how to print a model and subsequently a population during the run (default:"short").
#' @param parallelize_folds: parallelize folds when cross-validating (default:TRUE)
#' @param parallelize.folds: parallelize folds when cross-validating (default:TRUE)
#' @param nb_generations: maximum number of generations to evolve the population.
#' @param nCores: the number of cores to execute the program. If nCores=1 than the program runs in a non parallel mode
#' @param seed: the seed to be used for reproductibility. If seed=NULL than it is not taken into account (default:NULL).
......@@ -80,7 +80,7 @@ terga1 <- function(sparsity = c(1:10),
# evolution options
nb_generations = 100, convergence = TRUE, convergence_steps = 10, evolve_k1 = TRUE,
# output options
plot = FALSE, verbose = TRUE, warnings = FALSE, debug = FALSE, print_ind_method = "short", parallelize_folds = TRUE,
plot = FALSE, verbose = TRUE, warnings = FALSE, debug = FALSE, print_ind_method = "short", parallelize.folds = TRUE,
# computing options
nCores = 4, seed = "NULL",
# experiment options
......@@ -127,7 +127,7 @@ terga1 <- function(sparsity = c(1:10),
# Computing options
clf$params$nCores <- nCores # parallel computing
clf$params$parallel <- nCores > 1 # parallel computing
clf$params$parallelize.folds <- parallelize_folds
clf$params$parallelize.folds <- parallelize.folds
clf$params$parallel.local <- FALSE
clf$params$seed <- seed
......
......@@ -96,7 +96,7 @@
#' (default:FALSE)
#' @param print_ind_method: One of c("short","graphical") indicates how to print
#' a model and subsequently a population during the run (default:"short").
#' @param parallelize_folds: parallelize folds when cross-validating (default:TRUE).
#' @param parallelize.folds: parallelize folds when cross-validating (default:TRUE).
#' @param nCores: The number of cores to execute the program. If nCores = 1 than
#' the program runs in a non parallel mode
#' @param seed: The seed to be used for reproductibility. If seed=NULL than it is
......@@ -133,7 +133,7 @@ terga2 <- function(sparsity = c(1:10), max.nb.features = 1000,
# evoluion options
evolver = "v2m", nb_generations = 100, convergence = TRUE, convergence_steps = 10, evolve_k1 = TRUE,
# output options
plot = FALSE, verbose = FALSE, warnings = FALSE, debug = FALSE, print_ind_method = "short", parallelize_folds = TRUE,
plot = FALSE, verbose = FALSE, warnings = FALSE, debug = FALSE, print_ind_method = "short", parallelize.folds = TRUE,
# computing options
nCores = 4, seed = "NULL", maxTime = Inf,
# experiment options
......@@ -223,7 +223,7 @@ terga2 <- function(sparsity = c(1:10), max.nb.features = 1000,
# Computing options
clf$params$nCores <- nCores # parallel computing
clf$params$parallel <- nCores > 1 # parallel computing
clf$params$parallelize_folds <- parallelize_folds
clf$params$parallelize_folds <- parallelize.folds
clf$params$parallel.local <- FALSE
clf$params$seed <- seed # fix the seed to be able to reproduce results
clf$params$maxTime <- maxTime
......
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