Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ Remotes:
Displayr/rhtmlLabeledScatter,
Displayr/rhtmlMoonPlot,
Displayr/verbs
RoxygenNote: 7.3.3
Encoding: UTF-8
Config/roxygen2/version: 8.0.0
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export(LDA.fit)
export(MachineLearning)
export(MachineLearningEnsemble)
export(MachineLearningMulti)
export(OrganiseCategoricalPredictors)
export(PredictOutcome)
export(PredictProbabilities)
export(Probabilities)
export(PropensityWeights)
export(RandomForest)
Expand Down
13 changes: 7 additions & 6 deletions R/machinelearning.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,14 @@ parametersEqual <- function(recipient, donor) {
return(FALSE)
}

#' organiseCategoricalPredictors
#' OrganiseCategoricalPredictors
#'
#' Organize information about categorical predictors in the model
#' @param input.model The machine learning model.
#' @param all.combo.boxes The selection of predictor values.
#' @export
#' @noRd
organiseCategoricalPredictors <- function(input.model, all.combo.boxes) {
OrganiseCategoricalPredictors <- function(input.model, all.combo.boxes) {
estimation.data.template <- input.model$estimation.data.template
all.variable.names <- names(estimation.data.template)
outcome.name <- attr(estimation.data.template, "outcome.name")
Expand Down Expand Up @@ -210,7 +211,7 @@ organiseCategoricalPredictors <- function(input.model, all.combo.boxes) {
return(xlevels)
}

#' predictOutcome
#' PredictOutcome
#'
#' Predict the outcome for a simulator for a machine learning model.
#' @param input.model The machine learning model.
Expand All @@ -219,7 +220,7 @@ organiseCategoricalPredictors <- function(input.model, all.combo.boxes) {
#' @importFrom utils getS3method
#' @export
#' @noRd
predictOutcome <- function(input.model, DF, is.numeric) {
PredictOutcome <- function(input.model, DF, is.numeric) {
vector.or.class <- if (is.numeric) "vector" else "class"
is.cart <- inherits(input.model, "CART")
is.lda <- inherits(input.model, "LDA")
Expand Down Expand Up @@ -247,15 +248,15 @@ predictOutcome <- function(input.model, DF, is.numeric) {
as.vector(do.call(prediction.function, arguments))
}

#' predictProbabilities
#' PredictProbabilities
#'
#' Predict the probabilities for a simulator for a machine learning model.
#' @param input.model The machine learning model.
#' @param DF The data frame containing the predictor values.
#' @importFrom utils getS3method
#' @export
#' @noRd
predictProbabilities <- function(input.model, DF) {
PredictProbabilities <- function(input.model, DF) {
model.classes <- class(input.model)
if ("SupportVectorMachine" %in% model.classes) {
svm.probs <- predict(input.model$original, newdata = DF, probability = TRUE)
Expand Down
Loading
Loading