diff --git a/DESCRIPTION b/DESCRIPTION index 2bc850f..cd1054d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: largeRCRF Type: Package Title: Large Random Competing Risk Forests, Java Implementation Run in R -Version: 0.0.0.9037 +Version: 0.0.0.9038 Authors@R: person("Joel", "Therrien", email = "joel@joeltherrien.ca", role = c("aut", "cre")) Description: This package is used for training competing risk random forests on larger scale datasets. It currently only supports training models, running predictions, plotting those predictions (they are curves), diff --git a/NAMESPACE b/NAMESPACE index 22ff28f..f728caa 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -25,6 +25,8 @@ export(LogRankSplitFinder) export(MeanResponseCombiner) export(Numeric) export(WeightedVarianceSplitFinder) +export(addTrees) +export(connectToData) export(extractCHF) export(extractCIF) export(extractMortalities) diff --git a/R/addTrees.R b/R/addTrees.R new file mode 100644 index 0000000..75331ee --- /dev/null +++ b/R/addTrees.R @@ -0,0 +1,128 @@ + + + +#' Add Trees +#' +#' Add more trees to an existing forest. Most parameters are extracted from the +#' previous forest. +#' +#' @param forest An existing forest. +#' @param numTreesToAdd The number of trees to add. +#' @param savePath If saving the forest, the directory to save to. Default is +#' \code{NULL}. Note that you need to respecify the path if you're modifying a +#' previously saved forest. +#' @param savePath.overwrite If \code{savePath} is pointing to an existing +#' directory, possibly containing another forest, this specifies what should +#' be done. +#' @param cores The number of cores to be used for training the new trees. +#' @param displayProgress A logical indicating whether the progress should be +#' displayed to console; default is \code{TRUE}. Useful to set to FALSE in +#' some automated situations. +#' +#' @return A new forest with the original and additional trees. +#' @export +#' +addTrees <- function(forest, numTreesToAdd, savePath = NULL, savePath.overwrite = c("warn", "delete", "merge"), cores = getCores(), displayProgress = TRUE){ + if(is.null(forest$dataset)){ + stop("Training dataset must be connected to forest before more trees can be added; this can be done manually by using connectToData") + } + + numTreesToAdd <- as.integer(numTreesToAdd) + + if(numTreesToAdd <= 0){ + stop("numTreesToAdd must be a positive integer") + } + + if(is.null(savePath.overwrite) | length(savePath.overwrite)==0 | !(savePath.overwrite[1] %in% c("warn", "delete", "merge"))){ + stop("savePath.overwrite must be one of c(\"warn\", \"delete\", \"merge\")") + } + + newTreeCount <- forest$params$ntree + as.integer(numTreesToAdd) + + treeTrainer <- createTreeTrainer(responseCombiner=forest$params$nodeResponseCombiner, + splitFinder=forest$params$splitFinder, + covariateList=forest$covariateList, + numberOfSplits=forest$params$numberOfSplits, + nodeSize=forest$params$nodeSize, + maxNodeDepth=forest$params$maxNodeDepth, + mtry=forest$params$mtry, + splitPureNodes=forest$params$splitPureNodes) + + forestTrainer <- createForestTrainer(treeTrainer=treeTrainer, + covariateList=forest$covariateList, + treeResponseCombiner=forest$params$forestResponseCombiner, + dataset=forest$dataset, + ntree=forest$params$ntree + numTreesToAdd, + randomSeed=forest$params$randomSeed, + saveTreeLocation=savePath, + displayProgress=displayProgress) + + params <- list( + splitFinder=forest$params$splitFinder, + nodeResponseCombiner=forest$params$nodeResponseCombiner, + forestResponseCombiner=forest$params$forestResponseCombiner, + ntree=forest$params$ntree + numTreesToAdd, + numberOfSplits=forest$params$numberOfSplits, + mtry=forest$params$mtry, + nodeSize=forest$params$nodeSize, + splitPureNodes=forest$params$splitPureNodes, + maxNodeDepth = forest$params$maxNodeDepth, + randomSeed=forest$params$randomSeed + ) + + initial.forest.optional <- .object_Optional(forest$javaObject) + + # We'll be saving an offline version of the forest + if(!is.null(savePath)){ + + if(file.exists(savePath)){ # we might have to remove the folder or display an error + + if(savePath.overwrite[1] == "warn"){ + stop(paste(savePath, "already exists; will not modify it. Please remove/rename it or set the savePath.overwrite to either 'delete' or 'merge'")) + } else if(savePath.overwrite[1] == "delete"){ + unlink(savePath, recursive=TRUE) + } else if(savePath.overwrite[1] == "merge"){ + warning("Assuming that the previous forest at savePath is the provided forest argument; if not true then your results will be suspect") + initial.forest.optional <- .object_Optional(NULL) # Java backend requires we be explicit about whether we're providing an in-memory initial forest or starting from a previous directory + } + + } + + if(savePath.overwrite[1] != "merge"){ + dir.create(savePath) + } + + # First save forest components (so that if the training crashes mid-way through it can theoretically be recovered by the user) + saveForestComponents(savePath, + covariateList=forest$covariateList, + params=params, + forestCall=match.call()) + + if(cores > 1){ + .jcall(forestTrainer, "V", "trainParallelOnDisk", initial.forest.optional, as.integer(cores)) + } else { + .jcall(forestTrainer, "V", "trainSerialOnDisk", initial.forest.optional) + } + + # Need to now load forest trees back into memory + forest.java <- .jcall(.class_DataUtils, makeResponse(.class_Forest), "loadForest", savePath, forest$params$forestResponseCombiner$javaObject) + + + } + else{ # save directly into memory + if(cores > 1){ + forest.java <- .jcall(forestTrainer, makeResponse(.class_Forest), "trainParallelInMemory", initial.forest.optional, as.integer(cores)) + } else { + forest.java <- .jcall(forestTrainer, makeResponse(.class_Forest), "trainSerialInMemory", initial.forest.optional) + } + } + + + + + forestObject <- list(call=match.call(), params=params, javaObject=forest.java, covariateList=forest$covariateList, dataset=forest$dataset) + + class(forestObject) <- "JRandomForest" + return(forestObject) + +} diff --git a/R/connectToData.R b/R/connectToData.R new file mode 100644 index 0000000..2b6bd75 --- /dev/null +++ b/R/connectToData.R @@ -0,0 +1,37 @@ +#' Connect To Data +#' +#' When a trained forest is saved, the training dataset is not saved alongside +#' it. When it's loaded back up, it can be more convenient (and in some cases +#' necessary) to import the training dataset back into the Java environment so +#' that it's readily accessible. There are only two functions that look for the +#' training dataset: \code{predict}, where you can easily just specify an +#' alternative dataset, or \code{\link{addTrees}}, which requires the training +#' dataset be connected. +#' @param forest The forest to connect data too +#' @param responses The responses in the data; aka the left hand side of the formula +#' @param covariateData A data.frame containing all of the covariates used in the training dataset +#' @return The same forest, but connected to the training data. +#' @export +#' @examples +#' data <- data.frame(x1=rnorm(1000), x2=rnorm(1000), y=rnorm(1000)) +#' forest <- train(y~x1+x2, data, ntree=100, numberOfSplits=0, nodeSize=1, mtry=1) +#' forest$dataset <- NULL # what the forest looks like after being loaded +#' +#' forest <- connectToData(forest, data$y, data) +connectToData <- function(forest, responses, covariateData){ + covariateList <- forest$covariateList + + numCovariates <- .jcall(covariateList, "I", "size") + covariateNames <- character(numCovariates) + + for(j in 1:numCovariates){ + covariate <- .jcall(covariateList, makeResponse(.class_Object), "get", as.integer(j-1)) + covariate <- .jcast(covariate, .class_Covariate) + covariateNames[j] <- .jcall(covariate, makeResponse(.class_String), "getName") + } + + forest$dataset <- loadData(covariateData, covariateNames, responses, covariateList)$dataset + + return(forest) + +} \ No newline at end of file diff --git a/R/java_classes_directory.R b/R/java_classes_directory.R index c94728f..00d271a 100644 --- a/R/java_classes_directory.R +++ b/R/java_classes_directory.R @@ -50,6 +50,16 @@ .class_LogRankSplitFinder <- "ca/joeltherrien/randomforest/responses/competingrisk/splitfinder/LogRankSplitFinder" .class_WeightedVarianceSplitFinder <- "ca/joeltherrien/randomforest/responses/regression/WeightedVarianceSplitFinder" +.object_Optional <- function(forest=NULL){ + if(is.null(forest)){ + return(.jcall("java/util/Optional", "Ljava/util/Optional;", "empty")) + } else{ + forest <- .jcast(forest, .class_Object) + return(.jcall("java/util/Optional", "Ljava/util/Optional;", "of", forest)) + } + +} + # When a class object is returned, rJava often often wants L prepended and ; appended. # So a list that returns "java/lang/Object" should show "Ljava/lang/Object;" # This function does that. diff --git a/R/loadData.R b/R/loadData.R index ded0e6e..9e870c2 100644 --- a/R/loadData.R +++ b/R/loadData.R @@ -1,10 +1,13 @@ -loadData <- function(data, xVarNames, responses){ +loadData <- function(data, xVarNames, responses, covariateList.java = NULL){ if(class(responses) == "integer" | class(responses) == "numeric"){ responses <- Numeric(responses) } - covariateList.java <- getCovariateList(data, xVarNames) + # connectToData provides a pre-created covariate list we can re-use + if(is.null(covariateList.java)){ + covariateList.java <- getCovariateList(data, xVarNames) + } textColumns <- list() for(j in 1:length(xVarNames)){ diff --git a/R/loadForest.R b/R/loadForest.R index 524a24f..d4600a2 100644 --- a/R/loadForest.R +++ b/R/loadForest.R @@ -43,7 +43,7 @@ loadForest <- function(directory){ params$forestResponseCombiner$javaObject <- forestResponseCombiner.java forest <- loadForestArgumentsSpecified(directory, params$nodeResponseCombiner, params$splitFinder, params$forestResponseCombiner, covariateList, call, - params$ntree, params$numberOfSplits, params$mtry, params$nodeSize, params$maxNodeDepth, params$splitPureNodes) + params$ntree, params$numberOfSplits, params$mtry, params$nodeSize, params$maxNodeDepth, params$splitPureNodes, params$randomSeed) return(forest) @@ -56,7 +56,7 @@ loadForest <- function(directory){ # I'd appreciate knowing that someone's going to use it first (email me; see # README). loadForestArgumentsSpecified <- function(treeDirectory, nodeResponseCombiner, splitFinder, forestResponseCombiner, - covariateList.java, call, ntree, numberOfSplits, mtry, nodeSize, maxNodeDepth = 100000, splitPureNodes=TRUE){ + covariateList.java, call, ntree, numberOfSplits, mtry, nodeSize, maxNodeDepth = 100000, splitPureNodes=TRUE, randomSeed=NULL){ params <- list( splitFinder=splitFinder, @@ -67,7 +67,8 @@ loadForestArgumentsSpecified <- function(treeDirectory, nodeResponseCombiner, sp mtry=mtry, nodeSize=nodeSize, splitPureNodes=splitPureNodes, - maxNodeDepth = maxNodeDepth + maxNodeDepth=maxNodeDepth, + randomSeed=randomSeed ) forest.java <- .jcall(.class_DataUtils, makeResponse(.class_Forest), "loadForest", treeDirectory, forestResponseCombiner$javaObject) diff --git a/R/predict.R b/R/predict.R index 383aa7e..aa21ee1 100644 --- a/R/predict.R +++ b/R/predict.R @@ -6,9 +6,9 @@ #' #' @param forest A forest that was previously \code{\link{train}}ed #' @param newData The new data containing all of the previous predictor -#' covariates. Note that even if predictions are being made on the training -#' set, the dataset must be specified. \code{largeRCRF} doesn't keep track of -#' the dataset after the forest is trained. +#' covariates. Can be NULL if you want to use the training dataset, and +#' \code{forest} hasn't been loaded from the disk; otherwise you'll have to +#' specify it. #' @param parallel A logical indicating whether multiple cores should be #' utilized when making the predictions. Available as an option because it's #' been observed that using Java's \code{parallelStream} can be unstable on @@ -16,7 +16,8 @@ #' get strange errors while predicting. #' @param out.of.bag A logical indicating whether predictions should be based on #' 'out of bag' trees; set only to \code{TRUE} if you're running predictions -#' on data that was used in the training. Default value is \code{FALSE}. +#' on data that was used in the training. Default value is \code{TRUE} if +#' \code{newData} is \code{NULL}, otherwise \code{FALSE}. #' @return A list of responses corresponding with each row of \code{newData} if #' it's a non-regression random forest; otherwise it returns a numeric vector. #' @export @@ -50,18 +51,33 @@ #' forest <- train(CR_Response(delta, u) ~ x1 + x2, data, ntree=100, numberOfSplits=5, mtry=1, nodeSize=10) #' newData <- data.frame(x1 = c(-1, 0, 1), x2 = 0) #' ypred <- predict(forest, newData) -predict.JRandomForest <- function(forest, newData=NULL, parallel=TRUE, out.of.bag=FALSE){ +predict.JRandomForest <- function(forest, newData=NULL, parallel=TRUE, out.of.bag=NULL){ + + if(is.null(newData) & is.null(forest$dataset)){ + stop("forest doesn't have a copy of the training data loaded (this happens if you just loaded it); please manually specify newData and possibly out.of.bag") + } + if(is.null(newData)){ - stop("newData must be specified, even if predictions are on the training set") + predictionDataList <- forest$dataset + + if(is.null(out.of.bag)){ + out.of.bag <- TRUE + } + } + else{ # newData is provided + if(is.null(out.of.bag)){ + out.of.bag <- FALSE + } + + predictionDataList <- loadPredictionData(newData, forest$covariateList) } + numRows <- .jcall(predictionDataList, "I", "size") + forestObject <- forest$javaObject - covariateList <- forest$covariateList predictionClass <- forest$params$forestResponseCombiner$outputClass convertToRFunction <- forest$params$forestResponseCombiner$convertToRFunction - predictionDataList <- loadPredictionData(newData, covariateList) - if(parallel){ function.to.use <- "evaluate" } @@ -82,8 +98,7 @@ predict.JRandomForest <- function(forest, newData=NULL, parallel=TRUE, out.of.ba predictions <- list() } - - for(i in 1:nrow(newData)){ + for(i in 1:numRows){ prediction <- .jcall(predictionsJava, makeResponse(.class_Object), "get", as.integer(i-1)) prediction <- convertToRFunction(prediction, forest) diff --git a/R/train.R b/R/train.R index 2756130..f0d3186 100644 --- a/R/train.R +++ b/R/train.R @@ -30,10 +30,12 @@ getCores <- function(){ #' #' @param responses An R list of the responses. See \code{\link{CR_Response}} #' for an example function. +#' @param data A data.frame containing the columns of the predictors and +#' responses; not relevant if you're not using the formula version of +#' \code{train}. #' @param covariateData A data.frame containing only the columns of the -#' covariates you wish to use in your training (unless you're using the -#' \code{formula} version of \code{train}, in which case it should contain the -#' response as well). +#' covariates you wish to use in your training (not relevant if you're using +#' the formula version of \code{train}). #' @param splitFinder A split finder that's used to score splits in the random #' forest training algorithm. See \code{\link{Competing Risk Split Finders}} #' or \code{\link{WeightedVarianceSplitFinder}}. If you don't specify one, @@ -78,10 +80,10 @@ getCores <- function(){ #' split a pure node. If set to FALSE, then before every split it will check #' that every response is the same, and if so, not split. If set to TRUE it #' forgoes that check and splits it. Prediction accuracy won't change under -#' any sensible \code{nodeResponseCombiner}; as all terminal nodes from a split -#' pure node should give the same prediction, so this parameter only affects -#' performance. If your response is continuous you'll likely experience faster -#' train times by setting it to TRUE. Default value is TRUE. +#' any sensible \code{nodeResponseCombiner}; as all terminal nodes from a +#' split pure node should give the same prediction, so this parameter only +#' affects performance. If your response is continuous you'll likely +#' experience faster train times by setting it to TRUE. Default value is TRUE. #' @param savePath If set, this parameter will save each tree of the random #' forest in this directory as the forest is trained. Use this parameter if #' you need to save memory while training. See also \code{\link{loadForest}} @@ -98,21 +100,24 @@ getCores <- function(){ #' a crash. #' @param cores This parameter specifies how many trees will be simultaneously #' trained. By default the package attempts to detect how many cores you have -#' by using the \code{parallel} package and using all of them. You may -#' specify a lower number if you wish. It is not recommended to specify a -#' number greater than the number of available cores as this will hurt -#' performance with no available benefit. +#' by using the \code{parallel} package and using all of them. You may specify +#' a lower number if you wish. It is not recommended to specify a number +#' greater than the number of available cores as this will hurt performance +#' with no available benefit. #' @param randomSeed This parameter specifies a random seed if reproducible, -#' deterministic forests are desired. +#' deterministic forests are desired. +#' @param displayProgress A logical indicating whether the progress should be +#' displayed to console; default is \code{TRUE}. Useful to set to FALSE in +#' some automated situations. #' @export #' @return A \code{JRandomForest} object. You may call \code{predict} or #' \code{print} on it. #' @seealso \code{\link{predict.JRandomForest}} -#' @note If saving memory is a concern, you can replace \code{covariateData} -#' with an environment containing one element called \code{data} as the actual -#' dataset. After the data has been imported into Java, but before the forest -#' training begins, the dataset in the environment is deleted, freeing up -#' memory in R. +#' @note If saving memory is a concern, you can replace \code{covariateData} or +#' \code{data} with an environment containing one element called \code{data} +#' as the actual dataset. After the data has been imported into Java, but +#' before the forest training begins, the dataset in the environment is +#' deleted, freeing up memory in R. #' @examples #' # Regression Example #' x1 <- rnorm(1000) @@ -150,7 +155,7 @@ train <- function(x, ...) UseMethod("train") #' @rdname train #' @export -train.default <- function(responses, covariateData, splitFinder = splitFinderDefault(responses), nodeResponseCombiner = nodeResponseCombinerDefault(responses), forestResponseCombiner = forestResponseCombinerDefault(responses), ntree, numberOfSplits, mtry, nodeSize, maxNodeDepth = 100000, splitPureNodes=TRUE, savePath=NULL, savePath.overwrite=c("warn", "delete", "merge"), cores = getCores(), randomSeed = NULL){ +train.default <- function(responses, covariateData, splitFinder = splitFinderDefault(responses), nodeResponseCombiner = nodeResponseCombinerDefault(responses), forestResponseCombiner = forestResponseCombinerDefault(responses), ntree, numberOfSplits, mtry, nodeSize, maxNodeDepth = 100000, splitPureNodes=TRUE, savePath=NULL, savePath.overwrite=c("warn", "delete", "merge"), cores = getCores(), randomSeed = NULL, displayProgress = TRUE){ # Some quick checks on parameters ntree <- as.integer(ntree) @@ -223,7 +228,8 @@ train.default <- function(responses, covariateData, splitFinder = splitFinderDef dataset=dataset$dataset, ntree=ntree, randomSeed=randomSeed, - saveTreeLocation=savePath) + saveTreeLocation=savePath, + displayProgress=displayProgress) params <- list( splitFinder=splitFinder, @@ -235,7 +241,7 @@ train.default <- function(responses, covariateData, splitFinder = splitFinderDef nodeSize=nodeSize, splitPureNodes=splitPureNodes, maxNodeDepth = maxNodeDepth, - savePath=savePath + randomSeed=randomSeed ) # We'll be saving an offline version of the forest @@ -262,9 +268,9 @@ train.default <- function(responses, covariateData, splitFinder = splitFinderDef forestCall=match.call()) if(cores > 1){ - .jcall(forestTrainer, "V", "trainParallelOnDisk", as.integer(cores)) + .jcall(forestTrainer, "V", "trainParallelOnDisk", .object_Optional(), as.integer(cores)) } else { - .jcall(forestTrainer, "V", "trainSerialOnDisk") + .jcall(forestTrainer, "V", "trainSerialOnDisk", .object_Optional()) } # Need to now load forest trees back into memory @@ -274,16 +280,16 @@ train.default <- function(responses, covariateData, splitFinder = splitFinderDef } else{ # save directly into memory if(cores > 1){ - forest.java <- .jcall(forestTrainer, makeResponse(.class_Forest), "trainParallelInMemory", as.integer(cores)) + forest.java <- .jcall(forestTrainer, makeResponse(.class_Forest), "trainParallelInMemory", .object_Optional(), as.integer(cores)) } else { - forest.java <- .jcall(forestTrainer, makeResponse(.class_Forest), "trainSerialInMemory") + forest.java <- .jcall(forestTrainer, makeResponse(.class_Forest), "trainSerialInMemory", .object_Optional()) } } - forestObject <- list(call=match.call(), params=params, javaObject=forest.java, covariateList=dataset$covariateList) + forestObject <- list(call=match.call(), params=params, javaObject=forest.java, covariateList=dataset$covariateList, dataset=dataset$dataset) class(forestObject) <- "JRandomForest" return(forestObject) @@ -298,19 +304,19 @@ train.default <- function(responses, covariateData, splitFinder = splitFinderDef #' @param formula You may specify the response and covariates as a formula #' instead; make sure the response in the formula is still properly #' constructed; see \code{responses} -train.formula <- function(formula, covariateData, ...){ +train.formula <- function(formula, data, ...){ # Having an R copy of the data loaded at the same time can be wasteful; we # also allow users to provide an environment of the data which gets removed # after being imported into Java env <- NULL - if(class(covariateData) == "environment"){ - if(is.null(covariateData$data)){ + if(class(data) == "environment"){ + if(is.null(data$data)){ stop("When providing an environment with the dataset, the environment must contain an item called 'data'") } - env <- covariateData - covariateData <- env$data + env <- data + data <- env$data } yVar <- formula[[2]] @@ -319,25 +325,25 @@ train.formula <- function(formula, covariateData, ...){ variablesToDrop <- character(0) # yVar is a call object; as.character(yVar) will be the different components, including the parameters. - # if the length of yVar is > 1 then it's a function call. If the length is 1, and it's not in covariateData, + # if the length of yVar is > 1 then it's a function call. If the length is 1, and it's not in data, # then we also need to explicitly evaluate it - if(class(yVar)=="call" || !(as.character(yVar) %in% colnames(covariateData))){ + if(class(yVar)=="call" || !(as.character(yVar) %in% colnames(data))){ # yVar is a function like CompetingRiskResponses - responses <- eval(expr=yVar, envir=covariateData) + responses <- eval(expr=yVar, envir=data) if(class(formula[[3]]) == "name" && as.character(formula[[3]])=="."){ - # do any of the variables match data in covariateData? We need to track that so we can drop them later - variablesToDrop <- as.character(yVar)[as.character(yVar) %in% names(covariateData)] + # do any of the variables match data in data? We need to track that so we can drop them later + variablesToDrop <- as.character(yVar)[as.character(yVar) %in% names(data)] } formula[[2]] <- NULL - } else if(class(yVar)=="name"){ # and implicitly yVar is contained in covariateData + } else if(class(yVar)=="name"){ # and implicitly yVar is contained in data variablesToDrop <- as.character(yVar) } # Includes responses which we may need to later cut out - mf <- model.frame(formula=formula, data=covariateData, na.action=na.pass) + mf <- model.frame(formula=formula, data=data, na.action=na.pass) if(is.null(responses)){ responses <- model.response(mf) @@ -349,7 +355,7 @@ train.formula <- function(formula, covariateData, ...){ # If environment was provided instead of data if(!is.null(env)){ env$data <- mf - rm(covariateData) + rm(data) forest <- train.default(responses, env, ...) } else{ forest <- train.default(responses, mf, ...) @@ -363,7 +369,14 @@ train.formula <- function(formula, covariateData, ...){ return(forest) } -createForestTrainer <- function(treeTrainer, covariateList, treeResponseCombiner, dataset, ntree, randomSeed, saveTreeLocation){ +createForestTrainer <- function(treeTrainer, + covariateList, + treeResponseCombiner, + dataset, + ntree, + randomSeed, + saveTreeLocation, + displayProgress){ builderClassReturned <- makeResponse(.class_ForestTrainer_Builder) builder <- .jcall(.class_ForestTrainer, builderClassReturned, "builder") @@ -373,7 +386,7 @@ createForestTrainer <- function(treeTrainer, covariateList, treeResponseCombiner builder <- .jcall(builder, builderClassReturned, "treeResponseCombiner", treeResponseCombiner$javaObject) builder <- .jcall(builder, builderClassReturned, "data", dataset) builder <- .jcall(builder, builderClassReturned, "ntree", as.integer(ntree)) - builder <- .jcall(builder, builderClassReturned, "displayProgress", TRUE) + builder <- .jcall(builder, builderClassReturned, "displayProgress", displayProgress) if(!is.null(randomSeed)){ builder <- .jcall(builder, builderClassReturned, "randomSeed", .jlong(randomSeed)) diff --git a/inst/java/ca/joeltherrien/randomforest/Main.class b/inst/java/ca/joeltherrien/randomforest/Main.class index 7a2d49f..af999f7 100644 Binary files a/inst/java/ca/joeltherrien/randomforest/Main.class and b/inst/java/ca/joeltherrien/randomforest/Main.class differ diff --git a/inst/java/ca/joeltherrien/randomforest/tree/ForestTrainer$ForestTrainerBuilder.class b/inst/java/ca/joeltherrien/randomforest/tree/ForestTrainer$ForestTrainerBuilder.class index ed390c8..2c9f620 100644 Binary files a/inst/java/ca/joeltherrien/randomforest/tree/ForestTrainer$ForestTrainerBuilder.class and b/inst/java/ca/joeltherrien/randomforest/tree/ForestTrainer$ForestTrainerBuilder.class differ diff --git a/inst/java/ca/joeltherrien/randomforest/tree/ForestTrainer$TreeInMemoryWorker.class b/inst/java/ca/joeltherrien/randomforest/tree/ForestTrainer$TreeInMemoryWorker.class index bc0e090..26eef7d 100644 Binary files a/inst/java/ca/joeltherrien/randomforest/tree/ForestTrainer$TreeInMemoryWorker.class and b/inst/java/ca/joeltherrien/randomforest/tree/ForestTrainer$TreeInMemoryWorker.class differ diff --git a/inst/java/ca/joeltherrien/randomforest/tree/ForestTrainer$TreeSavedWorker.class b/inst/java/ca/joeltherrien/randomforest/tree/ForestTrainer$TreeSavedWorker.class index cee655d..9a7a0e5 100644 Binary files a/inst/java/ca/joeltherrien/randomforest/tree/ForestTrainer$TreeSavedWorker.class and b/inst/java/ca/joeltherrien/randomforest/tree/ForestTrainer$TreeSavedWorker.class differ diff --git a/inst/java/ca/joeltherrien/randomforest/tree/ForestTrainer.class b/inst/java/ca/joeltherrien/randomforest/tree/ForestTrainer.class index 4a34a6d..58ff3b1 100644 Binary files a/inst/java/ca/joeltherrien/randomforest/tree/ForestTrainer.class and b/inst/java/ca/joeltherrien/randomforest/tree/ForestTrainer.class differ diff --git a/inst/java/com/fasterxml/jackson/core/JsonTokenId.class b/inst/java/com/fasterxml/jackson/core/JsonTokenId.class deleted file mode 100644 index 2624069..0000000 Binary files a/inst/java/com/fasterxml/jackson/core/JsonTokenId.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/core/JsonpCharacterEscapes.class b/inst/java/com/fasterxml/jackson/core/JsonpCharacterEscapes.class deleted file mode 100644 index 4416566..0000000 Binary files a/inst/java/com/fasterxml/jackson/core/JsonpCharacterEscapes.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/core/async/ByteBufferFeeder.class b/inst/java/com/fasterxml/jackson/core/async/ByteBufferFeeder.class deleted file mode 100644 index ba6aaa5..0000000 Binary files a/inst/java/com/fasterxml/jackson/core/async/ByteBufferFeeder.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/core/filter/FilteringGeneratorDelegate.class b/inst/java/com/fasterxml/jackson/core/filter/FilteringGeneratorDelegate.class deleted file mode 100644 index e336d71..0000000 Binary files a/inst/java/com/fasterxml/jackson/core/filter/FilteringGeneratorDelegate.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/core/format/DataFormatDetector.class b/inst/java/com/fasterxml/jackson/core/format/DataFormatDetector.class deleted file mode 100644 index 25528a6..0000000 Binary files a/inst/java/com/fasterxml/jackson/core/format/DataFormatDetector.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/core/sym/Name.class b/inst/java/com/fasterxml/jackson/core/sym/Name.class deleted file mode 100644 index 4b15cf7..0000000 Binary files a/inst/java/com/fasterxml/jackson/core/sym/Name.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/core/sym/Name1.class b/inst/java/com/fasterxml/jackson/core/sym/Name1.class deleted file mode 100644 index 8ba93f6..0000000 Binary files a/inst/java/com/fasterxml/jackson/core/sym/Name1.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/core/sym/Name2.class b/inst/java/com/fasterxml/jackson/core/sym/Name2.class deleted file mode 100644 index b7584ed..0000000 Binary files a/inst/java/com/fasterxml/jackson/core/sym/Name2.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/core/sym/Name3.class b/inst/java/com/fasterxml/jackson/core/sym/Name3.class deleted file mode 100644 index f1f5311..0000000 Binary files a/inst/java/com/fasterxml/jackson/core/sym/Name3.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/core/sym/NameN.class b/inst/java/com/fasterxml/jackson/core/sym/NameN.class deleted file mode 100644 index 86f1d91..0000000 Binary files a/inst/java/com/fasterxml/jackson/core/sym/NameN.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/core/util/JsonGeneratorDelegate.class b/inst/java/com/fasterxml/jackson/core/util/JsonGeneratorDelegate.class deleted file mode 100644 index a4ad46a..0000000 Binary files a/inst/java/com/fasterxml/jackson/core/util/JsonGeneratorDelegate.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/deser/std/DelegatingDeserializer.class b/inst/java/com/fasterxml/jackson/databind/deser/std/DelegatingDeserializer.class deleted file mode 100644 index 449360e..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/deser/std/DelegatingDeserializer.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/deser/std/StdNodeBasedDeserializer.class b/inst/java/com/fasterxml/jackson/databind/deser/std/StdNodeBasedDeserializer.class deleted file mode 100644 index a7c5933..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/deser/std/StdNodeBasedDeserializer.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/ext/CoreXMLDeserializers$Std.class b/inst/java/com/fasterxml/jackson/databind/ext/CoreXMLDeserializers$Std.class deleted file mode 100644 index 5789f6f..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/ext/CoreXMLDeserializers$Std.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/ext/CoreXMLDeserializers.class b/inst/java/com/fasterxml/jackson/databind/ext/CoreXMLDeserializers.class deleted file mode 100644 index 37b4467..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/ext/CoreXMLDeserializers.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/ext/CoreXMLSerializers$XMLGregorianCalendarSerializer.class b/inst/java/com/fasterxml/jackson/databind/ext/CoreXMLSerializers$XMLGregorianCalendarSerializer.class deleted file mode 100644 index 5fa29c1..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/ext/CoreXMLSerializers$XMLGregorianCalendarSerializer.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/ext/CoreXMLSerializers.class b/inst/java/com/fasterxml/jackson/databind/ext/CoreXMLSerializers.class deleted file mode 100644 index 8ba5e73..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/ext/CoreXMLSerializers.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/ext/DOMDeserializer$DocumentDeserializer.class b/inst/java/com/fasterxml/jackson/databind/ext/DOMDeserializer$DocumentDeserializer.class deleted file mode 100644 index 9800e01..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/ext/DOMDeserializer$DocumentDeserializer.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/ext/DOMDeserializer$NodeDeserializer.class b/inst/java/com/fasterxml/jackson/databind/ext/DOMDeserializer$NodeDeserializer.class deleted file mode 100644 index 0da1686..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/ext/DOMDeserializer$NodeDeserializer.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/ext/DOMDeserializer.class b/inst/java/com/fasterxml/jackson/databind/ext/DOMDeserializer.class deleted file mode 100644 index b9fa08a..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/ext/DOMDeserializer.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/ext/DOMSerializer.class b/inst/java/com/fasterxml/jackson/databind/ext/DOMSerializer.class deleted file mode 100644 index cec5306..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/ext/DOMSerializer.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/ext/Java7SupportImpl.class b/inst/java/com/fasterxml/jackson/databind/ext/Java7SupportImpl.class deleted file mode 100644 index 199eeab..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/ext/Java7SupportImpl.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/ext/NioPathDeserializer.class b/inst/java/com/fasterxml/jackson/databind/ext/NioPathDeserializer.class deleted file mode 100644 index e9e87f7..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/ext/NioPathDeserializer.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/ext/NioPathSerializer.class b/inst/java/com/fasterxml/jackson/databind/ext/NioPathSerializer.class deleted file mode 100644 index fd08e56..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/ext/NioPathSerializer.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/introspect/WithMember.class b/inst/java/com/fasterxml/jackson/databind/introspect/WithMember.class deleted file mode 100644 index 957001e..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/introspect/WithMember.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/module/SimpleAbstractTypeResolver.class b/inst/java/com/fasterxml/jackson/databind/module/SimpleAbstractTypeResolver.class deleted file mode 100644 index ce5207d..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/module/SimpleAbstractTypeResolver.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/module/SimpleDeserializers.class b/inst/java/com/fasterxml/jackson/databind/module/SimpleDeserializers.class deleted file mode 100644 index c3fb7ae..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/module/SimpleDeserializers.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/module/SimpleKeyDeserializers.class b/inst/java/com/fasterxml/jackson/databind/module/SimpleKeyDeserializers.class deleted file mode 100644 index feef1f1..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/module/SimpleKeyDeserializers.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/module/SimpleModule.class b/inst/java/com/fasterxml/jackson/databind/module/SimpleModule.class deleted file mode 100644 index 60909b1..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/module/SimpleModule.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/module/SimpleSerializers.class b/inst/java/com/fasterxml/jackson/databind/module/SimpleSerializers.class deleted file mode 100644 index 03fe19a..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/module/SimpleSerializers.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/module/SimpleValueInstantiators.class b/inst/java/com/fasterxml/jackson/databind/module/SimpleValueInstantiators.class deleted file mode 100644 index c1265be..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/module/SimpleValueInstantiators.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/ser/impl/SimpleFilterProvider.class b/inst/java/com/fasterxml/jackson/databind/ser/impl/SimpleFilterProvider.class deleted file mode 100644 index ab82e05..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/ser/impl/SimpleFilterProvider.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/ser/std/NonTypedScalarSerializerBase.class b/inst/java/com/fasterxml/jackson/databind/ser/std/NonTypedScalarSerializerBase.class deleted file mode 100644 index 79bd32b..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/ser/std/NonTypedScalarSerializerBase.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/util/ISO8601DateFormat.class b/inst/java/com/fasterxml/jackson/databind/util/ISO8601DateFormat.class deleted file mode 100644 index 30354bc..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/util/ISO8601DateFormat.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/util/ISO8601Utils.class b/inst/java/com/fasterxml/jackson/databind/util/ISO8601Utils.class deleted file mode 100644 index 9719b9b..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/util/ISO8601Utils.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/util/JSONPObject.class b/inst/java/com/fasterxml/jackson/databind/util/JSONPObject.class deleted file mode 100644 index 9b351da..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/util/JSONPObject.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/util/JSONWrappedObject.class b/inst/java/com/fasterxml/jackson/databind/util/JSONWrappedObject.class deleted file mode 100644 index 9809ea9..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/util/JSONWrappedObject.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/databind/util/StdConverter.class b/inst/java/com/fasterxml/jackson/databind/util/StdConverter.class deleted file mode 100644 index fbb00d2..0000000 Binary files a/inst/java/com/fasterxml/jackson/databind/util/StdConverter.class and /dev/null differ diff --git a/inst/java/com/fasterxml/jackson/dataformat/yaml/YAMLMapper.class b/inst/java/com/fasterxml/jackson/dataformat/yaml/YAMLMapper.class deleted file mode 100644 index 35c3036..0000000 Binary files a/inst/java/com/fasterxml/jackson/dataformat/yaml/YAMLMapper.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/LoaderOptions.class b/inst/java/org/yaml/snakeyaml/LoaderOptions.class deleted file mode 100644 index d26bfc9..0000000 Binary files a/inst/java/org/yaml/snakeyaml/LoaderOptions.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/TypeDescription.class b/inst/java/org/yaml/snakeyaml/TypeDescription.class deleted file mode 100644 index 274b6a4..0000000 Binary files a/inst/java/org/yaml/snakeyaml/TypeDescription.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/Yaml$1.class b/inst/java/org/yaml/snakeyaml/Yaml$1.class deleted file mode 100644 index 3e0103f..0000000 Binary files a/inst/java/org/yaml/snakeyaml/Yaml$1.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/Yaml$2.class b/inst/java/org/yaml/snakeyaml/Yaml$2.class deleted file mode 100644 index e0cc162..0000000 Binary files a/inst/java/org/yaml/snakeyaml/Yaml$2.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/Yaml$3.class b/inst/java/org/yaml/snakeyaml/Yaml$3.class deleted file mode 100644 index b66ec02..0000000 Binary files a/inst/java/org/yaml/snakeyaml/Yaml$3.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/Yaml$EventIterable.class b/inst/java/org/yaml/snakeyaml/Yaml$EventIterable.class deleted file mode 100644 index 4332a0d..0000000 Binary files a/inst/java/org/yaml/snakeyaml/Yaml$EventIterable.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/Yaml$NodeIterable.class b/inst/java/org/yaml/snakeyaml/Yaml$NodeIterable.class deleted file mode 100644 index a6f090e..0000000 Binary files a/inst/java/org/yaml/snakeyaml/Yaml$NodeIterable.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/Yaml$SilentEmitter.class b/inst/java/org/yaml/snakeyaml/Yaml$SilentEmitter.class deleted file mode 100644 index 832390d..0000000 Binary files a/inst/java/org/yaml/snakeyaml/Yaml$SilentEmitter.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/Yaml$YamlIterable.class b/inst/java/org/yaml/snakeyaml/Yaml$YamlIterable.class deleted file mode 100644 index f392652..0000000 Binary files a/inst/java/org/yaml/snakeyaml/Yaml$YamlIterable.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/Yaml.class b/inst/java/org/yaml/snakeyaml/Yaml.class deleted file mode 100644 index 96a8ba1..0000000 Binary files a/inst/java/org/yaml/snakeyaml/Yaml.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/composer/Composer.class b/inst/java/org/yaml/snakeyaml/composer/Composer.class deleted file mode 100644 index aa9f352..0000000 Binary files a/inst/java/org/yaml/snakeyaml/composer/Composer.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/composer/ComposerException.class b/inst/java/org/yaml/snakeyaml/composer/ComposerException.class deleted file mode 100644 index e9e40a7..0000000 Binary files a/inst/java/org/yaml/snakeyaml/composer/ComposerException.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/AbstractConstruct.class b/inst/java/org/yaml/snakeyaml/constructor/AbstractConstruct.class deleted file mode 100644 index 2fc8455..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/AbstractConstruct.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/BaseConstructor$RecursiveTuple.class b/inst/java/org/yaml/snakeyaml/constructor/BaseConstructor$RecursiveTuple.class deleted file mode 100644 index 6a52121..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/BaseConstructor$RecursiveTuple.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/BaseConstructor.class b/inst/java/org/yaml/snakeyaml/constructor/BaseConstructor.class deleted file mode 100644 index 928d7ee..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/BaseConstructor.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/Construct.class b/inst/java/org/yaml/snakeyaml/constructor/Construct.class deleted file mode 100644 index 4e04609..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/Construct.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/Constructor$1.class b/inst/java/org/yaml/snakeyaml/constructor/Constructor$1.class deleted file mode 100644 index 727dd0d..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/Constructor$1.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/Constructor$ConstructMapping.class b/inst/java/org/yaml/snakeyaml/constructor/Constructor$ConstructMapping.class deleted file mode 100644 index 28da69d..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/Constructor$ConstructMapping.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/Constructor$ConstructScalar.class b/inst/java/org/yaml/snakeyaml/constructor/Constructor$ConstructScalar.class deleted file mode 100644 index 13ed472..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/Constructor$ConstructScalar.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/Constructor$ConstructSequence.class b/inst/java/org/yaml/snakeyaml/constructor/Constructor$ConstructSequence.class deleted file mode 100644 index 79ab601..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/Constructor$ConstructSequence.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/Constructor$ConstructYamlObject.class b/inst/java/org/yaml/snakeyaml/constructor/Constructor$ConstructYamlObject.class deleted file mode 100644 index 5966776..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/Constructor$ConstructYamlObject.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/Constructor.class b/inst/java/org/yaml/snakeyaml/constructor/Constructor.class deleted file mode 100644 index a396e4e..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/Constructor.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/ConstructorException.class b/inst/java/org/yaml/snakeyaml/constructor/ConstructorException.class deleted file mode 100644 index 6b09e03..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/ConstructorException.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/CustomClassLoaderConstructor.class b/inst/java/org/yaml/snakeyaml/constructor/CustomClassLoaderConstructor.class deleted file mode 100644 index 9d21300..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/CustomClassLoaderConstructor.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$1.class b/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$1.class deleted file mode 100644 index 49120ad..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$1.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructUndefined.class b/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructUndefined.class deleted file mode 100644 index e8acf83..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructUndefined.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlBinary.class b/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlBinary.class deleted file mode 100644 index a69c49d..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlBinary.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlBool.class b/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlBool.class deleted file mode 100644 index 36d20b1..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlBool.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlFloat.class b/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlFloat.class deleted file mode 100644 index 8dc70a1..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlFloat.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlInt.class b/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlInt.class deleted file mode 100644 index b9442d9..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlInt.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlMap.class b/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlMap.class deleted file mode 100644 index 80c080c..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlMap.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlNull.class b/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlNull.class deleted file mode 100644 index 0af0bca..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlNull.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlNumber.class b/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlNumber.class deleted file mode 100644 index 8ff5328..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlNumber.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlOmap.class b/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlOmap.class deleted file mode 100644 index f71236f..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlOmap.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlPairs.class b/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlPairs.class deleted file mode 100644 index 8775eb6..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlPairs.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlSeq.class b/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlSeq.class deleted file mode 100644 index 4b0e45e..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlSeq.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlSet.class b/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlSet.class deleted file mode 100644 index 0da57b7..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlSet.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlStr.class b/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlStr.class deleted file mode 100644 index 602119d..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlStr.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlTimestamp.class b/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlTimestamp.class deleted file mode 100644 index 8a71aba..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor$ConstructYamlTimestamp.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor.class b/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor.class deleted file mode 100644 index cc2800b..0000000 Binary files a/inst/java/org/yaml/snakeyaml/constructor/SafeConstructor.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/extensions/compactnotation/CompactConstructor$ConstructCompactObject.class b/inst/java/org/yaml/snakeyaml/extensions/compactnotation/CompactConstructor$ConstructCompactObject.class deleted file mode 100644 index 2a7d62c..0000000 Binary files a/inst/java/org/yaml/snakeyaml/extensions/compactnotation/CompactConstructor$ConstructCompactObject.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/extensions/compactnotation/CompactConstructor.class b/inst/java/org/yaml/snakeyaml/extensions/compactnotation/CompactConstructor.class deleted file mode 100644 index 73c6614..0000000 Binary files a/inst/java/org/yaml/snakeyaml/extensions/compactnotation/CompactConstructor.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/extensions/compactnotation/CompactData.class b/inst/java/org/yaml/snakeyaml/extensions/compactnotation/CompactData.class deleted file mode 100644 index 9c5b706..0000000 Binary files a/inst/java/org/yaml/snakeyaml/extensions/compactnotation/CompactData.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/extensions/compactnotation/PackageCompactConstructor.class b/inst/java/org/yaml/snakeyaml/extensions/compactnotation/PackageCompactConstructor.class deleted file mode 100644 index 24c4b76..0000000 Binary files a/inst/java/org/yaml/snakeyaml/extensions/compactnotation/PackageCompactConstructor.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/external/biz/base64Coder/Base64Coder.class b/inst/java/org/yaml/snakeyaml/external/biz/base64Coder/Base64Coder.class deleted file mode 100644 index 0b9d353..0000000 Binary files a/inst/java/org/yaml/snakeyaml/external/biz/base64Coder/Base64Coder.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/introspector/BeanAccess.class b/inst/java/org/yaml/snakeyaml/introspector/BeanAccess.class deleted file mode 100644 index e944654..0000000 Binary files a/inst/java/org/yaml/snakeyaml/introspector/BeanAccess.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/introspector/FieldProperty.class b/inst/java/org/yaml/snakeyaml/introspector/FieldProperty.class deleted file mode 100644 index cfb1c23..0000000 Binary files a/inst/java/org/yaml/snakeyaml/introspector/FieldProperty.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/introspector/GenericProperty.class b/inst/java/org/yaml/snakeyaml/introspector/GenericProperty.class deleted file mode 100644 index aeac78a..0000000 Binary files a/inst/java/org/yaml/snakeyaml/introspector/GenericProperty.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/introspector/MethodProperty.class b/inst/java/org/yaml/snakeyaml/introspector/MethodProperty.class deleted file mode 100644 index d7e32e9..0000000 Binary files a/inst/java/org/yaml/snakeyaml/introspector/MethodProperty.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/introspector/MissingProperty.class b/inst/java/org/yaml/snakeyaml/introspector/MissingProperty.class deleted file mode 100644 index 063c195..0000000 Binary files a/inst/java/org/yaml/snakeyaml/introspector/MissingProperty.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/introspector/Property.class b/inst/java/org/yaml/snakeyaml/introspector/Property.class deleted file mode 100644 index 0009220..0000000 Binary files a/inst/java/org/yaml/snakeyaml/introspector/Property.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/introspector/PropertyUtils$1.class b/inst/java/org/yaml/snakeyaml/introspector/PropertyUtils$1.class deleted file mode 100644 index a113e2d..0000000 Binary files a/inst/java/org/yaml/snakeyaml/introspector/PropertyUtils$1.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/introspector/PropertyUtils.class b/inst/java/org/yaml/snakeyaml/introspector/PropertyUtils.class deleted file mode 100644 index 2cb237b..0000000 Binary files a/inst/java/org/yaml/snakeyaml/introspector/PropertyUtils.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/nodes/AnchorNode.class b/inst/java/org/yaml/snakeyaml/nodes/AnchorNode.class deleted file mode 100644 index 76190ed..0000000 Binary files a/inst/java/org/yaml/snakeyaml/nodes/AnchorNode.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/nodes/CollectionNode.class b/inst/java/org/yaml/snakeyaml/nodes/CollectionNode.class deleted file mode 100644 index e438af8..0000000 Binary files a/inst/java/org/yaml/snakeyaml/nodes/CollectionNode.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/nodes/MappingNode.class b/inst/java/org/yaml/snakeyaml/nodes/MappingNode.class deleted file mode 100644 index dae97bd..0000000 Binary files a/inst/java/org/yaml/snakeyaml/nodes/MappingNode.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/nodes/NodeTuple.class b/inst/java/org/yaml/snakeyaml/nodes/NodeTuple.class deleted file mode 100644 index 7a9a1b0..0000000 Binary files a/inst/java/org/yaml/snakeyaml/nodes/NodeTuple.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/nodes/ScalarNode.class b/inst/java/org/yaml/snakeyaml/nodes/ScalarNode.class deleted file mode 100644 index 9940a99..0000000 Binary files a/inst/java/org/yaml/snakeyaml/nodes/ScalarNode.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/nodes/SequenceNode.class b/inst/java/org/yaml/snakeyaml/nodes/SequenceNode.class deleted file mode 100644 index b17f48b..0000000 Binary files a/inst/java/org/yaml/snakeyaml/nodes/SequenceNode.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/BaseRepresenter$1.class b/inst/java/org/yaml/snakeyaml/representer/BaseRepresenter$1.class deleted file mode 100644 index 061dc4f..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/BaseRepresenter$1.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/BaseRepresenter.class b/inst/java/org/yaml/snakeyaml/representer/BaseRepresenter.class deleted file mode 100644 index 14804eb..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/BaseRepresenter.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/Represent.class b/inst/java/org/yaml/snakeyaml/representer/Represent.class deleted file mode 100644 index 4161bdb..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/Represent.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/Representer$RepresentJavaBean.class b/inst/java/org/yaml/snakeyaml/representer/Representer$RepresentJavaBean.class deleted file mode 100644 index ce69e37..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/Representer$RepresentJavaBean.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/Representer.class b/inst/java/org/yaml/snakeyaml/representer/Representer.class deleted file mode 100644 index f4df64a..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/Representer.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$IteratorWrapper.class b/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$IteratorWrapper.class deleted file mode 100644 index 4a582a6..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$IteratorWrapper.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentArray.class b/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentArray.class deleted file mode 100644 index 00a147a..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentArray.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentBoolean.class b/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentBoolean.class deleted file mode 100644 index 7fdcb10..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentBoolean.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentByteArray.class b/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentByteArray.class deleted file mode 100644 index 3e16121..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentByteArray.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentDate.class b/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentDate.class deleted file mode 100644 index c1d3097..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentDate.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentEnum.class b/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentEnum.class deleted file mode 100644 index 0e6cff5..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentEnum.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentIterator.class b/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentIterator.class deleted file mode 100644 index b8e6421..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentIterator.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentList.class b/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentList.class deleted file mode 100644 index 0df1f6b..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentList.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentMap.class b/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentMap.class deleted file mode 100644 index 90d1eb1..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentMap.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentNull.class b/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentNull.class deleted file mode 100644 index 5f49e60..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentNull.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentNumber.class b/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentNumber.class deleted file mode 100644 index de99dab..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentNumber.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentPrimitiveArray.class b/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentPrimitiveArray.class deleted file mode 100644 index fafc9f1..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentPrimitiveArray.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentSet.class b/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentSet.class deleted file mode 100644 index 938655a..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentSet.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentString.class b/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentString.class deleted file mode 100644 index 0f32ab2..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentString.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentUuid.class b/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentUuid.class deleted file mode 100644 index a26a650..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter$RepresentUuid.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter.class b/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter.class deleted file mode 100644 index 6fbea56..0000000 Binary files a/inst/java/org/yaml/snakeyaml/representer/SafeRepresenter.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/serializer/Serializer$1.class b/inst/java/org/yaml/snakeyaml/serializer/Serializer$1.class deleted file mode 100644 index a69dfc4..0000000 Binary files a/inst/java/org/yaml/snakeyaml/serializer/Serializer$1.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/serializer/Serializer.class b/inst/java/org/yaml/snakeyaml/serializer/Serializer.class deleted file mode 100644 index a7aeec8..0000000 Binary files a/inst/java/org/yaml/snakeyaml/serializer/Serializer.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/serializer/SerializerException.class b/inst/java/org/yaml/snakeyaml/serializer/SerializerException.class deleted file mode 100644 index a9ab8bb..0000000 Binary files a/inst/java/org/yaml/snakeyaml/serializer/SerializerException.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/tokens/CommentToken.class b/inst/java/org/yaml/snakeyaml/tokens/CommentToken.class deleted file mode 100644 index 665e9b5..0000000 Binary files a/inst/java/org/yaml/snakeyaml/tokens/CommentToken.class and /dev/null differ diff --git a/inst/java/org/yaml/snakeyaml/tokens/WhitespaceToken.class b/inst/java/org/yaml/snakeyaml/tokens/WhitespaceToken.class deleted file mode 100644 index ff1c31b..0000000 Binary files a/inst/java/org/yaml/snakeyaml/tokens/WhitespaceToken.class and /dev/null differ diff --git a/man/addTrees.Rd b/man/addTrees.Rd new file mode 100644 index 0000000..ddeeb92 --- /dev/null +++ b/man/addTrees.Rd @@ -0,0 +1,36 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/addTrees.R +\name{addTrees} +\alias{addTrees} +\title{Add Trees} +\usage{ +addTrees(forest, numTreesToAdd, savePath = NULL, + savePath.overwrite = c("warn", "delete", "merge"), + cores = getCores(), displayProgress = TRUE) +} +\arguments{ +\item{forest}{An existing forest.} + +\item{numTreesToAdd}{The number of trees to add.} + +\item{savePath}{If saving the forest, the directory to save to. Default is +\code{NULL}. Note that you need to respecify the path if you're modifying a +previously saved forest.} + +\item{savePath.overwrite}{If \code{savePath} is pointing to an existing +directory, possibly containing another forest, this specifies what should +be done.} + +\item{cores}{The number of cores to be used for training the new trees.} + +\item{displayProgress}{A logical indicating whether the progress should be +displayed to console; default is \code{TRUE}. Useful to set to FALSE in +some automated situations.} +} +\value{ +A new forest with the original and additional trees. +} +\description{ +Add more trees to an existing forest. Most parameters are extracted from the +previous forest. +} diff --git a/man/connectToData.Rd b/man/connectToData.Rd new file mode 100644 index 0000000..331e357 --- /dev/null +++ b/man/connectToData.Rd @@ -0,0 +1,34 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/connectToData.R +\name{connectToData} +\alias{connectToData} +\title{Connect To Data} +\usage{ +connectToData(forest, responses, covariateData) +} +\arguments{ +\item{forest}{The forest to connect data too} + +\item{responses}{The responses in the data; aka the left hand side of the formula} + +\item{covariateData}{A data.frame containing all of the covariates used in the training dataset} +} +\value{ +The same forest, but connected to the training data. +} +\description{ +When a trained forest is saved, the training dataset is not saved alongside +it. When it's loaded back up, it can be more convenient (and in some cases +necessary) to import the training dataset back into the Java environment so +that it's readily accessible. There are only two functions that look for the +training dataset: \code{predict}, where you can easily just specify an +alternative dataset, or \code{\link{addTrees}}, which requires the training +dataset be connected. +} +\examples{ +data <- data.frame(x1=rnorm(1000), x2=rnorm(1000), y=rnorm(1000)) +forest <- train(y~x1+x2, data, ntree=100, numberOfSplits=0, nodeSize=1, mtry=1) +forest$dataset <- NULL # what the forest looks like after being loaded + +forest <- connectToData(forest, data$y, data) +} diff --git a/man/predict.JRandomForest.Rd b/man/predict.JRandomForest.Rd index 7bf71d8..83f3297 100644 --- a/man/predict.JRandomForest.Rd +++ b/man/predict.JRandomForest.Rd @@ -5,15 +5,15 @@ \title{Predict} \usage{ \method{predict}{JRandomForest}(forest, newData = NULL, - parallel = TRUE, out.of.bag = FALSE) + parallel = TRUE, out.of.bag = NULL) } \arguments{ \item{forest}{A forest that was previously \code{\link{train}}ed} \item{newData}{The new data containing all of the previous predictor -covariates. Note that even if predictions are being made on the training -set, the dataset must be specified. \code{largeRCRF} doesn't keep track of -the dataset after the forest is trained.} +covariates. Can be NULL if you want to use the training dataset, and +\code{forest} hasn't been loaded from the disk; otherwise you'll have to +specify it.} \item{parallel}{A logical indicating whether multiple cores should be utilized when making the predictions. Available as an option because it's @@ -23,7 +23,8 @@ get strange errors while predicting.} \item{out.of.bag}{A logical indicating whether predictions should be based on 'out of bag' trees; set only to \code{TRUE} if you're running predictions -on data that was used in the training. Default value is \code{FALSE}.} +on data that was used in the training. Default value is \code{TRUE} if +\code{newData} is \code{NULL}, otherwise \code{FALSE}.} } \value{ A list of responses corresponding with each row of \code{newData} if diff --git a/man/train.Rd b/man/train.Rd index e6beb19..1b08007 100644 --- a/man/train.Rd +++ b/man/train.Rd @@ -15,18 +15,17 @@ train(x, ...) ntree, numberOfSplits, mtry, nodeSize, maxNodeDepth = 1e+05, splitPureNodes = TRUE, savePath = NULL, savePath.overwrite = c("warn", "delete", "merge"), - cores = getCores(), randomSeed = NULL) + cores = getCores(), randomSeed = NULL, displayProgress = TRUE) -\method{train}{formula}(formula, covariateData, ...) +\method{train}{formula}(formula, data, ...) } \arguments{ \item{responses}{An R list of the responses. See \code{\link{CR_Response}} for an example function.} \item{covariateData}{A data.frame containing only the columns of the -covariates you wish to use in your training (unless you're using the -\code{formula} version of \code{train}, in which case it should contain the -response as well).} +covariates you wish to use in your training (not relevant if you're using +the formula version of \code{train}).} \item{splitFinder}{A split finder that's used to score splits in the random forest training algorithm. See \code{\link{Competing Risk Split Finders}} @@ -80,10 +79,10 @@ number and tree depth is controlled by \code{nodeSize}.} split a pure node. If set to FALSE, then before every split it will check that every response is the same, and if so, not split. If set to TRUE it forgoes that check and splits it. Prediction accuracy won't change under -any sensible \code{nodeResponseCombiner}; as all terminal nodes from a split -pure node should give the same prediction, so this parameter only affects -performance. If your response is continuous you'll likely experience faster -train times by setting it to TRUE. Default value is TRUE.} +any sensible \code{nodeResponseCombiner}; as all terminal nodes from a +split pure node should give the same prediction, so this parameter only +affects performance. If your response is continuous you'll likely +experience faster train times by setting it to TRUE. Default value is TRUE.} \item{savePath}{If set, this parameter will save each tree of the random forest in this directory as the forest is trained. Use this parameter if @@ -103,17 +102,25 @@ a crash.} \item{cores}{This parameter specifies how many trees will be simultaneously trained. By default the package attempts to detect how many cores you have -by using the \code{parallel} package and using all of them. You may -specify a lower number if you wish. It is not recommended to specify a -number greater than the number of available cores as this will hurt -performance with no available benefit.} +by using the \code{parallel} package and using all of them. You may specify +a lower number if you wish. It is not recommended to specify a number +greater than the number of available cores as this will hurt performance +with no available benefit.} \item{randomSeed}{This parameter specifies a random seed if reproducible, deterministic forests are desired.} +\item{displayProgress}{A logical indicating whether the progress should be +displayed to console; default is \code{TRUE}. Useful to set to FALSE in +some automated situations.} + \item{formula}{You may specify the response and covariates as a formula instead; make sure the response in the formula is still properly constructed; see \code{responses}} + +\item{data}{A data.frame containing the columns of the predictors and +responses; not relevant if you're not using the formula version of +\code{train}.} } \value{ A \code{JRandomForest} object. You may call \code{predict} or @@ -133,11 +140,11 @@ from the data (so feel free to not specify them), and \code{splitFinder} can be inferred but you might want to change its default. } \note{ -If saving memory is a concern, you can replace \code{covariateData} - with an environment containing one element called \code{data} as the actual - dataset. After the data has been imported into Java, but before the forest - training begins, the dataset in the environment is deleted, freeing up - memory in R. +If saving memory is a concern, you can replace \code{covariateData} or + \code{data} with an environment containing one element called \code{data} + as the actual dataset. After the data has been imported into Java, but + before the forest training begins, the dataset in the environment is + deleted, freeing up memory in R. } \examples{ # Regression Example diff --git a/tests/testthat/test_adding_new_trees.R b/tests/testthat/test_adding_new_trees.R new file mode 100644 index 0000000..08a1172 --- /dev/null +++ b/tests/testthat/test_adding_new_trees.R @@ -0,0 +1,71 @@ +context("Add trees on existing forest") + +test_that("Can add trees on existing forest", { + + trainingData <- data.frame(x=rnorm(100)) + trainingData$T <- rexp(100) + abs(trainingData$x) + trainingData$delta <- sample(0:2, size = 100, replace=TRUE) + + forest <- train(CR_Response(delta, T) ~ x, trainingData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=2, displayProgress=FALSE) + + predictions <- predict(forest) + + forest.more <- addTrees(forest, 50, cores=2, displayProgress=FALSE) # test multi-core + + predictions <- predict(forest) + + forest.more <- addTrees(forest.more, 50, cores=1, displayProgress=FALSE) # test single-core + + expect_true(T) # show Ok if we got this far + +}) + +test_that("Test adding trees on saved forest - using delete", { + + expect_false(file.exists("trees")) # Folder shouldn't exist yet + + trainingData <- data.frame(x=rnorm(100)) + trainingData$T <- rexp(100) + abs(trainingData$x) + trainingData$delta <- sample(0:2, size = 100, replace=TRUE) + + forest <- train(CR_Response(delta, T) ~ x, trainingData, ntree=50, numberOfSplits=0, + mtry=1, nodeSize=5, cores=2, + savePath="trees", displayProgress=FALSE + ) + + forest.more <- addTrees(forest, 50, cores=2, savePath = "trees", savePath.overwrite="delete", displayProgress=FALSE) + + predictions <- predict(forest) + + unlink("trees", recursive=TRUE) + + expect_true(T) # show Ok if we got this far + +}) + +test_that("Test adding trees on saved forest - using merge", { + + expect_false(file.exists("trees")) # Folder shouldn't exist yet + + trainingData <- data.frame(x=rnorm(100)) + trainingData$T <- rexp(100) + abs(trainingData$x) + trainingData$delta <- sample(0:2, size = 100, replace=TRUE) + + forest <- train(CR_Response(delta, T) ~ x, trainingData, ntree=50, numberOfSplits=0, + mtry=1, nodeSize=5, cores=2, + savePath="trees", displayProgress=FALSE + ) + + expect_warning( + addTrees(forest, 50, + cores=2, + savePath = "trees", + savePath.overwrite="merge", + displayProgress=FALSE), + "Assuming that the previous forest at savePath is the provided forest argument; if not true then your results will be suspect" ) + + unlink("trees", recursive=TRUE) + + expect_true(T) # show Ok if we got this far + +}) \ No newline at end of file diff --git a/tests/testthat/test_deterministic_forests.R b/tests/testthat/test_deterministic_forests.R index 7e18231..f03c66f 100644 --- a/tests/testthat/test_deterministic_forests.R +++ b/tests/testthat/test_deterministic_forests.R @@ -9,11 +9,11 @@ test_that("Two forests produce identical results", { data <- data.frame(x1, x2, y) forest1 <- train(y ~ x1 + x2, data, ntree=100, numberOfSplits = 5, mtry = 1, nodeSize = 5, - randomSeed=5) + randomSeed=5, displayProgress=FALSE) forest2 <- train(y ~ x1 + x2, data, ntree=100, numberOfSplits = 5, mtry = 1, nodeSize = 5, - randomSeed=5) + randomSeed=5, displayProgress=FALSE) newData <- data.frame(x1=rnorm(10), x2=rnorm(10)) predictions1 <- predict(forest1, newData) @@ -35,15 +35,17 @@ test_that("Finishing an interrupted forest produces the same results as having f data <- data.frame(x1, x2, y) forest1 <- train(y ~ x1 + x2, data, ntree=100, numberOfSplits = 5, mtry = 1, nodeSize = 5, - randomSeed=6) + randomSeed=6, displayProgress=FALSE) forest2.incomplete <- train(y ~ x1 + x2, data, ntree=50, numberOfSplits = 5, mtry = 1, nodeSize = 5, - randomSeed=6, savePath="trees_deterministic_forests") + randomSeed=6, savePath="trees_deterministic_forests", + displayProgress=FALSE) forest2.complete <- train(y ~ x1 + x2, data, ntree=100, numberOfSplits = 5, mtry = 1, nodeSize = 5, randomSeed=6, savePath="trees_deterministic_forests", - savePath.overwrite="merge") + savePath.overwrite="merge", + displayProgress=FALSE) newData <- data.frame(x1=rnorm(10), x2=rnorm(10)) @@ -56,3 +58,28 @@ test_that("Finishing an interrupted forest produces the same results as having f unlink("trees_deterministic_forests", recursive=TRUE) }) + +test_that("Adding trees is equivalent to training all at once", { + + x1 <- rnorm(100) + x2 <- rnorm(100) + y <- 1 + x1 + x2 + rnorm(100) + + data <- data.frame(x1, x2, y) + forest1 <- train(y ~ x1 + x2, data, + ntree=100, numberOfSplits = 5, mtry = 1, nodeSize = 5, + randomSeed=5, displayProgress=FALSE) + + forest2 <- train(y ~ x1 + x2, data, + ntree=50, numberOfSplits = 5, mtry = 1, nodeSize = 5, + randomSeed=5, displayProgress=FALSE) + forest2 <- addTrees(forest2, 50, displayProgress=FALSE) + + newData <- data.frame(x1=rnorm(10), x2=rnorm(10)) + predictions1 <- predict(forest1, newData) + predictions2 <- predict(forest2, newData) + + expect_equal(round(predictions1, digits=6), round(predictions2, digits=6)) + + +}) diff --git a/tests/testthat/test_factors.R b/tests/testthat/test_factors.R index ca94e99..4b4b413 100644 --- a/tests/testthat/test_factors.R +++ b/tests/testthat/test_factors.R @@ -10,7 +10,7 @@ test_that("Competing Risks doesn't crash", { testData <- sampleData[1:5,] trainingData <- sampleData[6:100,] - forest <- train(CR_Response(delta, Time) ~ x + z, trainingData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=2) + forest <- train(CR_Response(delta, Time) ~ x + z, trainingData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=2, displayProgress=FALSE) predictions <- predict(forest, testData) @@ -27,7 +27,7 @@ test_that("Regresssion doesn't crash", { testData <- sampleData[1:5,] trainingData <- sampleData[6:100,] - forest <- train(y ~ x + z, trainingData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=2) + forest <- train(y ~ x + z, trainingData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=2, displayProgress=FALSE) predictions <- predict(forest, testData) diff --git a/tests/testthat/test_na.R b/tests/testthat/test_na.R index ebf8ab1..ee0e299 100644 --- a/tests/testthat/test_na.R +++ b/tests/testthat/test_na.R @@ -11,7 +11,7 @@ test_that("Competing Risks doesn't crash", { testData <- sampleData[1:5,] trainingData <- sampleData[6:100,] - forest <- train(CR_Response(delta, Time) ~ x, trainingData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=2) + forest <- train(CR_Response(delta, Time) ~ x, trainingData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=2, displayProgress=FALSE) predictions <- predict(forest, testData) @@ -29,7 +29,7 @@ test_that("Regresssion doesn't crash", { testData <- sampleData[1:5,] trainingData <- sampleData[6:100,] - forest <- train(y ~ x, trainingData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=2) + forest <- train(y ~ x, trainingData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=2, displayProgress=FALSE) predictions <- predict(forest, testData) diff --git a/tests/testthat/test_predicting_training_data.R b/tests/testthat/test_predicting_training_data.R new file mode 100644 index 0000000..59330f4 --- /dev/null +++ b/tests/testthat/test_predicting_training_data.R @@ -0,0 +1,32 @@ +context("Predict without re-specifying training data") + +test_that("Can predict without new data", { + + trainingData <- data.frame(x=rnorm(100)) + trainingData$T <- rexp(100) + abs(trainingData$x) + trainingData$delta <- sample(0:2, size = 100, replace=TRUE) + + forest <- train(CR_Response(delta, T) ~ x, trainingData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=2, displayProgress=FALSE) + + predictions <- predict(forest) + + expect_true(T) # show Ok if we got this far + +}) + +test_that("Can connect new data", { + + trainingData <- data.frame(x=rnorm(100)) + trainingData$T <- rexp(100) + abs(trainingData$x) + trainingData$delta <- sample(0:2, size = 100, replace=TRUE) + + forest <- train(CR_Response(delta, T) ~ x, trainingData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=2, displayProgress=FALSE) + + forest$dataset <- NULL + forest <- connectToData(forest, CR_Response(trainingData$delta, trainingData$T), trainingData) + + predictions <- predict(forest) + + expect_true(T) # show Ok if we got this far + +}) \ No newline at end of file diff --git a/tests/testthat/test_running.R b/tests/testthat/test_running.R index 34d42e4..b235b61 100644 --- a/tests/testthat/test_running.R +++ b/tests/testthat/test_running.R @@ -9,7 +9,7 @@ test_that("Competing Risks doesn't crash", { testData <- sampleData[1:5,] trainingData <- sampleData[6:100,] - forest <- train(CR_Response(delta, T) ~ x, trainingData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=2) + forest <- train(CR_Response(delta, T) ~ x, trainingData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=2, displayProgress=FALSE) predictions <- predict(forest, testData) @@ -25,7 +25,7 @@ test_that("Regresssion doesn't crash", { testData <- sampleData[1:5,] trainingData <- sampleData[6:100,] - forest <- train(y ~ x, trainingData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=2) + forest <- train(y ~ x, trainingData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=2, displayProgress=FALSE) predictions <- predict(forest, testData) diff --git a/tests/testthat/test_running_environment.R b/tests/testthat/test_running_environment.R index 199de65..1941eab 100644 --- a/tests/testthat/test_running_environment.R +++ b/tests/testthat/test_running_environment.R @@ -13,12 +13,16 @@ test_that("Training with environment works", { e$data <- trainingData rm(trainingData) - forest <- train(CR_Response(delta, T) ~ x, e, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=2) + forest <- train(CR_Response(delta, T) ~ x, e, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=2, displayProgress=FALSE) expect_null(e$data) predictions <- predict(forest, testData) + forest <- addTrees(forest, 50, displayProgress = FALSE) + + predictions <- predict(forest, testData) + expect_true(T) # show Ok if we got this far }) diff --git a/tests/testthat/test_saving_loading.R b/tests/testthat/test_saving_loading.R index 19ae578..1d7a425 100644 --- a/tests/testthat/test_saving_loading.R +++ b/tests/testthat/test_saving_loading.R @@ -10,7 +10,8 @@ test_that("Can save & load regression example", { data <- data.frame(x1, x2, y) forest <- train(y ~ x1 + x2, data, - ntree=100, numberOfSplits = 5, mtry = 1, nodeSize = 5) + ntree=100, numberOfSplits = 5, mtry = 1, nodeSize = 5, + displayProgress=FALSE) saveForest(forest, "trees_saving_loading") diff --git a/tests/testthat/test_saving_offline.R b/tests/testthat/test_saving_offline.R index 9d2ac9b..123d157 100644 --- a/tests/testthat/test_saving_offline.R +++ b/tests/testthat/test_saving_offline.R @@ -11,7 +11,7 @@ test_that("Can save a random forest while training, and use it afterward", { data <- data.frame(x1, x2, y) forest <- train(y ~ x1 + x2, data, ntree=100, numberOfSplits = 5, mtry = 1, nodeSize = 5, - savePath="trees") + savePath="trees", displayProgress=FALSE) expect_true(file.exists("trees")) # Something should have been saved diff --git a/tests/testthat/test_verify_response_not_used_in_formula.R b/tests/testthat/test_verify_response_not_used_in_formula.R index 7a97d91..72e30f0 100644 --- a/tests/testthat/test_verify_response_not_used_in_formula.R +++ b/tests/testthat/test_verify_response_not_used_in_formula.R @@ -6,7 +6,13 @@ test_that("CompetingRisks - response not included", { sampleData$Time <- rexp(100) + abs(sampleData$x) sampleData$delta <- sample(0:2, size = 100, replace=TRUE) - forest <- train(CR_Response(delta, Time) ~ ., sampleData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=1) + forest <- train(CR_Response(delta, Time) ~ ., sampleData, + ntree=50, + numberOfSplits=0, + mtry=1, + nodeSize=5, + cores=1, + displayProgress=FALSE) expect_equal(rJava::.jcall(forest$covariateList, "I", "size"), 1) @@ -19,7 +25,7 @@ test_that("CompetingRisksWithCensorTimes - response not included", { sampleData$CensorTime <- rexp(100) + abs(sampleData$x) sampleData$delta <- sample(0:2, size = 100, replace=TRUE) - forest <- train(CR_Response(delta, Time, CensorTime) ~ ., sampleData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=1) + forest <- train(CR_Response(delta, Time, CensorTime) ~ ., sampleData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=1, displayProgress=FALSE) expect_equal(rJava::.jcall(forest$covariateList, "I", "size"), 1) @@ -30,7 +36,7 @@ test_that("Regression - response not included", { sampleData <- data.frame(x=rnorm(100)) sampleData$y <- rexp(100) + sampleData$x - forest <- train(y ~ ., sampleData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=1) + forest <- train(y ~ ., sampleData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=1, displayProgress=FALSE) expect_equal(rJava::.jcall(forest$covariateList, "I", "size"), 1) @@ -41,7 +47,7 @@ test_that("Regression - response not included (with Numeric)", { sampleData <- data.frame(x=rnorm(100)) sampleData$y <- rexp(100) + sampleData$x - forest <- train(Numeric(y) ~ ., sampleData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=1) + forest <- train(Numeric(y) ~ ., sampleData, ntree=50, numberOfSplits=0, mtry=1, nodeSize=5, cores=1, displayProgress=FALSE) expect_equal(rJava::.jcall(forest$covariateList, "I", "size"), 1)