lifecycle::badge("experimental")
Examples of predict functions that can be used in
cross_validate_fn()
.
They can either be used directly or be starting points.
predict_functions(name)
A function with the following form:
function(test_data, model, formula, hyperparameters, train_data) {
# Use model to predict test_data
# Return predictions
}
Name of model to get predict function for, as it appears in the following table.
The Model HParams column lists hyperparameters used in the respective model function.
Name | Function | Model HParams |
"lm" | stats::lm() | |
"lmer" | lme4::lmer() | |
"glm_binomial" | stats::glm() | family = "binomial" |
"glmer_binomial" | lme4::glmer() | family = "binomial" |
"svm_gaussian" | e1071::svm() | type = "eps-regression" |
"svm_binomial" | e1071::svm() | type = "C-classification" , probability = TRUE |
"svm_multinomial" | e1071::svm() | type = "C-classification" , probability = TRUE |
"naive_bayes" | e1071::naiveBayes() | |
"nnet_multinom" | nnet::multinom() | |
"nnet_gaussian" | nnet::nnet() | linout = TRUE |
"nnet_binomial" | nnet::nnet() | |
"randomForest_gaussian" | randomForest::randomForest() | |
"randomForest_binomial" | randomForest::randomForest() | |
"randomForest_multinomial" | randomForest::randomForest() |
Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk
Other example functions:
model_functions()
,
preprocess_functions()
,
update_hyperparameters()