Nothing
Code
foo(dat)
Condition
Error:
! At least one of the class levels is not a valid R variable name; This will cause errors when class probabilities are generated because the variables names will be converted to X0, X1 . Please use factor levels that can be used as valid R variable names (see ?make.names for help).
Code
foo(dat)
Condition
Error:
! Class probabilities are needed to score models using the area under the ROC curve. Set `classProbs = TRUE` in the trainControl() function.
You are trying to do regression and your outcome only has two possible values Are you trying to do classification? If so, use a 2 level factor as your outcome column.
Code
foo()
Condition
Error in `ctrl$summaryFunction()`:
! Your outcome has 7 levels. The twoClassSummary() function isn't appropriate.
Code
train(x, y, method = "lm")
Condition
Error:
! Please use column names for `x`
Code
train(x, letters[1:10], method = "lm")
Condition
Error:
! wrong model type for classification
Code
train(dat[, 1:3], dat$y, method = incomplete)
Condition
Error:
! some required components are missing: predict, prob
Code
train(dat[, 1:3], dat$y, method = "nosuchmodel99")
Condition
Error:
! Model nosuchmodel99 is not in caret's built-in library
Code
train(dat[, 1:3], dat$y, method = "lda")
Condition
Error:
! wrong model type for regression
Code
train(dat[, 1:3], dat$y, method = "lm", preProcess = "bogus")
Condition
Error:
! pre-processing methods are limited to: BoxCox, YeoJohnson, expoTrans, invHyperbolicSine, center, scale, range, knnImpute, bagImpute, medianImpute, pca, ica, spatialSign, ignore, keep, remove, zv, nzv, conditionalX, corr
Code
train(dat[, 1:4], y, method = "lda")
Condition
Error:
! One or more factor levels in the outcome has no data: 'empty'
Code
train(cls[, 1:4], cls$Species, method = "lda", metric = "RMSE")
Condition
Error:
! Metric RMSE not applicable for classification models
Code
train(reg[, 1:3], reg$y, method = "lm", metric = "Accuracy")
Condition
Error:
! Metric Accuracy not applicable for regression models
Code
train(reg[, 1:3], reg$y, method = "lm", trControl = trainControl(sampling = "down"))
Condition
Error:
! sampling methods are only implemented for classification problems
Code
train(reg[, 1:3], reg$y, method = "lm", trControl = trainControl(method = "oob"))
Condition
Error:
! Out of bag estimates are not implemented for this model
You are trying to do regression and your outcome only has two possible values Are you trying to do classification? If so, use a 2 level factor as your outcome column.
Class probabilities were requested for a model that does not implement them
cannnot compute class probabilities for regression
Code
train(reg[, 1:3], rep(c(TRUE, FALSE), 10), method = "lda")
Condition
Error:
! Please make sure that the outcome column is a factor or numeric. The class(es) of the column: 'logical'
Code
train(reg[, 1:3], as.Date("2020-01-01") + 1:20, method = "lda")
Condition
Error:
! Please make sure that the outcome column is a factor or numeric. The class(es) of the column: 'Date'
Code
train(strings, y, method = "svmSpectrumString")
Condition
Error:
! Please use column names for `x`
Code
train(numeric_x, y, method = "svmSpectrumString")
Condition
Error:
! 'x' should be a character matrix with a single column for string kernel methods
Code
train(data.frame(a = strings), y, method = "svmSpectrumString")
Condition
Error:
! 'x' should be a character matrix with a single column for string kernel methods
Code
train(Species ~ ., data = cls, method = "knn", tuneGrid = data.frame(bogus = 5))
Condition
Error:
! The tuning parameter grid should have columns k
Code
train(Species ~ ., data = cls, method = "knn", tuneGrid = data.frame(k = 5,
bogus = 1))
Condition
Error:
! The tuning parameter grid should have columns k
Code
train(reg[, 1:3], reg$y, method = "lm", trControl = trainControl(method = "cv",
savePredictions = "some"))
Condition
Error:
! `savePredictions` should be either logical or "all", "final" or "none"
Code
train(Species ~ ., data = cls, method = "knn", tuneGrid = data.frame(k = 5),
trControl = trainControl(method = "adaptive_cv", number = 4, adaptive = list(
min = 2, alpha = 0.05, method = "gls", complete = TRUE)))
Condition
Error:
! For adaptive resampling, there needs to be more than one tuning parameter for evaluation
Code
train(reg[, 1:3], reg$y, method = bad_loop, tuneLength = 2)
Condition
Error:
! The 'loop' function should produce a list with elements 'loop' and 'submodels'
The metric "RMSE" was not in the result set. MedianError will be used instead.
Code
train(Species ~ ., data = cls, method = "knn", tuneGrid = data.frame(kk = 5))
Condition
Error:
! The tuning parameter grid should have columns k
Code
train(Species ~ ., data = cls, method = knn_extra, tuneGrid = data.frame(extra = 1))
Condition
Error:
! The tuning parameter grid should have columns k, extra
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.