The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
yardstickSummary() turns a
yardstick::metric_set() into a function for the
summaryFunction argument of trainControl(), so
any yardstick metric (e.g. mcc,
brier_class, ccc, huber_loss) can
be used to evaluate and tune models. The default maximize
value in train(), rfe(), gafs(),
and safs() now uses each yardstick metric’s direction, so
loss metrics such as brier_class are minimized instead of
maximized.postResample(),
defaultSummary(), twoClassSummary(),
prSummary(), multiClassSummary(), and the
accuracy and Kappa values of confusionMatrix() are now
computed with yardstick. pROC is no
longer a dependency and MLmetrics is no longer
suggested. The metric names are unchanged and most values are identical,
with these exceptions:
prAUC in
multiClassSummary() and AUC in
prSummary()) uses yardstick’s pr_auc().
MLmetrics dropped the start of the curve (recall of
zero), so the area between zero and the recall at the highest predicted
probability was never counted, and PR AUC was underestimated (e.g. a
model that perfectly separates three events from the non-events had a
value of 0.667). The difference is largest for small resamples and for
models that rank events first. When every sample is an event, the value
is now 1 instead of NA.multiClassSummary(), macro averages such as
Mean_Precision, Mean_F1, and
Mean_Sensitivity now exclude classes where the statistic is
undefined (e.g. a class that is never predicted) instead of returning
NA.postResample() now errors when pred and
obs have different lengths.sensitivity(), specificity(),
posPredValue(), negPredValue(),
precision(), recall(), F_meas(),
R2(), RMSE(), and MAE() (and so
the by-class statistics of confusionMatrix() and
thresholder()) are also computed with
yardstick. Their arguments and values are unchanged,
except:
na.rm = FALSE, missing values now give
NA; previously a missing prediction was counted as an
incorrect one.R2(formula = "traditional", na.rm = TRUE) now drops
incomplete pairs of observed and predicted values consistently.R2(), RMSE(), and MAE()
accept predictions in a one-column matrix or data frame (such as the
data.table returned by caretEnsemble’s
predict() method). A data frame previously gave
NA with a warning.F_meas() is 0, not NaN, when both
precision and recall are 0.precision(), recall(), and
F_meas() no longer error when the two factors have the same
levels in a different order.sensitivity(),
specificity(), posPredValue(), and
negPredValue() now use their
positive/negative arguments, which were
silently ignored.mnLogLoss() and the ROC calculations in
filterVarImp() now use. Results are unchanged except that
mnLogLoss() clips predicted probabilities at
.Machine$double.eps instead of 1e-15, which
slightly changes the log loss when a probability is exactly zero. caret
now requires R >= 4.1, the version that recipes and
yardstick already require.maxDissim() and predict.icr() also validate
their arguments before loading proxy and
fastICA.xgbTree and xgbDART can now tune the L2
(lambda) and L1 (alpha) regularization
parameters (@dgenio,
#1415, issue 1187). The
default grid uses xgboost’s defaults (lambda = 1,
alpha = 0) and random search samples both on a log scale.
Existing grids without lambda and alpha
columns still work and give the same results as before; the missing
columns are filled in with those defaults.xgbTree, xgbDART, and
xgbLinear now work with xgboost 3.0.0 or
later, which they now require (issue 1412, issue 1371, issue 1359, issue 1270).
Boosters from xgboost 3 can’t have list elements added, so the
information caret stores with a fitted model (xNames,
obsLevels, problemType,
tuneValue, and param) is kept in attributes of
finalModel for these models,
e.g. attr(fit$finalModel, "obsLevels"). Predictions for
submodels use iterationrange instead of the deprecated
ntreelimit. Options passed to train() through
... that are not arguments of xgb.train()
(e.g. nthread, max_bin, or
objective) are passed to xgboost in params, so
they no longer give deprecation warnings.defaults
element, a named list of values for tuning parameters that can be left
out of tuneGrid (and of the param argument of
update()). This allows tuning parameters to be added to an
existing model without breaking grids written for it.earth model now defines a trim method,
so trainControl(trim = TRUE) reduces the size of fitted
earth models (dropping the stored x,
y, and call) without affecting
predictions.cccmat) was never
populated and always returned a matrix of ones; both cccmat
and diffmat scrambled their entries (breaking symmetry) for
four or more models; and
filter_on_corr/filter_on_diff removed the
wrong models due to an index-permutation error.confusionMatrix() now gives its intended “the table
must nrow = ncol” error for non-square tables, instead of an “invalid
argument to unary operator” error from a mis-written check.print.nullModel() no longer swaps the model-type label;
a classification null model now prints “Null Classification Model” (and
regression prints “Null Regression Model”).svmBag$pred so that bagging with
svmBag works: it called an undefined lev() and
dispatched predict() without loading
kernlab; both now use the kernlab
namespace explicitly.modelLookup() now gives its intended “Model ‘…’ is not
in the set of existing models” error for an unknown model, instead of an
“object ‘method’ not found” error from a mistyped variable name.icr() now works; it
previously forwarded an unused weights argument (and an
undefined thresh) into fastICA, which errored
with “unused argument (weights = …)”.sensitivity(),
specificity(), posPredValue(),
negPredValue(), precision(), and
recall() now give their intended “the table must have nrow
= ncol” and “the table must the same groups in the same order” errors,
instead of an “invalid argument type” error from the same mis-written
!all.equal() check that was fixed for
confusionMatrix().bagEarth() and bagFDA() now accept a
one-column matrix or data frame as the outcome. The code meant to reduce
such an outcome to its first column, but the guard around it tested
is.vector() after calling as.vector(), which
is always true (a list is a vector), so the reduction never ran and a
one-column data frame failed with “invalid type (list) for variable
‘.outcome’”.filterVarImp(): a data set with
exactly one factor predictor errored during the factor-to-numeric
conversion (a missing drop = FALSE), and the documented
... options were never actually forwarded to
lm() or loess() for regression outcomes.filterVarImp() no longer errors for a classification
outcome with three or more classes when x has a single
predictor (a missing drop = FALSE).filterVarImp() now gives correct importances for
outcomes with four or more classes. Each class should get the largest
AUC among the pairwise comparisons that include it, but the pairs were
chosen by the class’s position rather than by membership, so some
relevant pairs were skipped and some unrelated ones were used. Results
for two or three classes are unchanged.diffmat() with “missing value where
TRUE/FALSE needed”.testing argument of train() reaches
the adaptive and recipe resampling workflows again. All four of their
foreach bodies opened with
testing <- FALSE, which overwrote the argument and made
every debug block in them unreachable.skunked() was kept only when it
failed (an inverted inherits(x, "try-error")
test), so those models were never dropped, and a failure would have
assigned the error object to the scores.predict.plsda() and predict.bagFDA() no
longer fail when the data being predicted has repeated row names. This
made trainControl(method = "optimism_boot") and
method = "boot_all" unusable with
method = "pls" (and "bagFDA"), since those
resampling schemes score the resampled training set itself: the fit
ended with “duplicate ‘row.names’ are not allowed” (issue
1515).safs() now really measures each iteration’s internal
fitness against the first one when the fitness has a single metric. The
baseline row was reduced to a vector by a missing
drop = FALSE, so the loop that subtracts it (driven by that
row’s column names) had nothing to iterate over and the values were
returned uncorrected.varImp() on a safs or gafs
object works again when the metric is minimized (the default for
regression). It passed drop = FALSE to
`[<-`, which a data frame does not accept, so the call
failed with “unused argument (drop = FALSE)”.gafs() accepts a function for pmutation
again, for a mutation probability that varies over the generations. The
call passed an undefined object, so any function failed
with “object ‘object’ not found”; it is now given the generation number.
print() on the result already described this case as
“Mutation probability: variable”.rfe() works with a recipe and
rfeControl(method = "LOOCV"). Choosing the subset size
screened the candidates on a per-size resample count, which
leave-one-out does not produce (it pools every prediction), so the call
failed with “object ‘Num_Resamples’ not found”.rfe() with a recipe now really makes columns with a
"performance var" role available to the summary function.
They were selected and passed down to the internal worker, which ignored
them, so a summary function could not see them (train(),
gafs() and safs() were unaffected).safs() a starting variable subset (a vector for
the initial element of functions) no longer
warns “argument is not a function”. The check called
formals() on every element before allowing for that case,
and the result was never used.resamples() now really checks that the models were
resampled the same way. The check compared the number of distinct row
counts against one using length(), which is always one, so
it never fired; it also examined the first resample every time instead
of each in turn. Models built from different resamples are now refused
with “The samples indices are not equal across resamples” rather than
silently compared.levelplot() on a diff.resamples object
works when a model is named "A" or "B". The
method added columns of those names next to one column per model, and
the collision left the reshaping step with nothing to work on
(“replacement has 0 rows”).train(preProcess = options) now really rejects a method
it does not know. The check read the names of the argument,
which an ordinary character vector does not have, so an unknown method
was accepted and the fit failed later with “Something is wrong; all the
… metric values are missing”.rfe() with a recipe now says “there are only N
predictors remaining. The sizes values are inconsistent
with this” when every requested subset size is larger than what the
recipe produces. That message could not be reached: it was guarded by an
earlier all(sizes < 2) test, which is TRUE
for the empty vector such sizes reduce to, so the less helpful “less
than two predictors remaining” was reported instead.rfe() works with a recipe and
rfeControl(method = "boot632"). The apparent-error pass
fits on every row, and the rows to score were taken as the complement of
those, which is empty; the call failed with “arguments imply differing
number of rows: 0, 1”. This is the same defect that (issue 1468)
fixed for sbf().varImp() on an sbf object works again. It
built the result with as.data.frame() on a table, which
yields a column of variable names and a column of counts, and then
renamed only the first of them “Overall” – so the sort was applied to
the names and failed with “invalid argument to unary operator”.sbf() works with
sbfControl(method = "LOOCV") and with
method = "boot632". Both passed their arguments to the
internal worker positionally, so the control object landed in the
testPerf slot and the control fell back to its own default
– which self-references, so the calls failed with “promise already under
evaluation: recursive default argument reference or earlier problems?”.
((issue 1468)
fixed the same failure for the recipe interface’s boot632
path.)rfe() with a recipe that gives a column the
"performance var" role works for any number of rows. The
check that discovers the metric names builds a dry run of at most ten
rows and bound the performance columns to it whole, so the call failed
with “arguments imply differing number of rows” unless the data happened
to have a multiple of ten rows (where cbind() recycled
instead). safs() and gafs() already sampled
those rows down to match.train() builds a model’s default tuning grid from the
pre-processed predictors for single-parameter models too, and honours
preProcOptions = list(pcaComp = ) when it does. Only models
with two or more parameters got this treatment, so
train(method = "rf", preProcess = "pca") chose
mtry values from the original predictor count and
randomForest then warned “invalid mtry: reset to within
valid range”.rfe() that tried to
build a resampled confusion matrix from the aggregated performance
table, which never carries the per-cell counts (they are kept in the
resample element, which is where
confusionMatrix() reads them). The resampledCM
element of an rfe object was always empty and still
is.predict.PLS() method. It was left
over from an internal PLS() function that caret dropped
before version 6.0: nothing in the package creates objects of class
"PLS", the fields it reads (isRegression,
yLevels, bestIter$.ncomp) exist nowhere else,
and pls models are of class "mvr", so no
object could ever dispatch to it.print.bmars() method, for the same
reason: nothing in the package creates objects of class
"bmars", so no object could dispatch to it.additivePlot()
function, which nothing in the package called.altTrainWorkflow()
function, an identity function that nothing in the package called.resampleHist() now really checks for the resampled
results it needs. The check used object$resample, which
partially matches the resampledCM element that
classification fits carry, so a fit without resampled results got past
it and failed later instead of giving the intended “No resample values
were found” message.summary.bagEarth() named a
bmarsCall element in its return value; the function returns
bagEarthCall.checkInstall() can install Bioconductor packages again.
It sourced biocLite.R, which Bioconductor retired with
release 3.8, and now uses BiocManager
instead (installing it first if needed).update() on a train object from caret
5.17-7 or earlier now looks the model type up by its exact name. It used
regular-expression matching, so updating an "lm" object
attached arm’s "bayesglm" information
instead.update() on a model that used preProcess
no longer warns that pre-processing methods “were eliminated”. It passed
the fitted pre-processing object’s method list back to
preProcess(), empty entries included.update() now re-fits with the original case weights
when the model was created with the formula interface. The formula
method re-saved trainingData without the
.weights column that the x/y interface keeps, so the
updated model was fit unweighted.predict() on a preProcess object from an
older caret version that used method = "invHyperbolicSine"
no longer fails with “$ operator is invalid for atomic vectors”. The
internal conversion of the old character vector of methods read the
transformation’s columns from that vector as if it were already a
list.print() on a preProcess object that
applies the spatial sign to independent components
(method = list(ica = ..., spatialSign = "_IC_")) no longer
fails with “replacement has length zero”. It counted the components with
the element that holds the number of principal components,
which such an object does not have.probFunction() and its recipe counterpart now really
order the class-probability columns by the observed class levels for
models whose prob function returns a matrix. In both, the
reordered result was assigned to a misspelled variable
(classprob) and discarded, so the original column order was
returned instead.preProcess(method = "corr") now really does add the
zero-variance filter it promises. The check that adds it ran after
method had been converted from a character vector to a
named list, so it never fired, and a zero-variance predictor made the
correlation matrix undefined: the call failed with “missing value where
TRUE/FALSE needed”. If that filter leaves a single predictor there is
nothing left to correlate, which is now handled rather than passed to
findCorrelation() (an “only one variable given”
error).adaptive = list(complete = TRUE)) to the
right tuning parameters when the model has sub-models. Those resamples
are only run once a single candidate is left, but its sub-models were
looked up in the grid the race started from, so predictions for
candidates that had already been eliminated were scored and then
labelled with the surviving parameters (“row names were found from a
short variable and have been discarded”). Both the x/y and the recipe
interface were affected, and the sub-model handling that pass carried –
unreachable, since the race stops at one candidate – has been removed (issue
1533).trainControl(savePredictions = "all") now records which
candidate made each prediction for the resamples the race starts from.
That phase was the only one that did not merge the tuning parameters
into the predictions it saved, so those rows came back with
NA for every parameter. The x/y interface was unaffected (issue
1534).resampledCM held NA counts for
them (issue
1534).resampleWrapper() function, which
could not run. It passed data to
createModel(), a signature that has not existed in this
repository’s history – createModel() has always taken
x/y – so every call failed with “argument”x”
is missing, with no default”. Nothing in the package called it, and no
reverse dependency mentions it (issue
1518).trainControl(method = "none") (issue 1307) (issue 1308)ptype element was added to train objects
that records the trianing set predictor columns and their types using a
zero-row slice.preProcess().PreProcess() bug related to a single PCA
component (issue
1181).rfe() (issue #1077),
(issue
1062).modeltype.stringsAsFactors = TRUE in R-4.0groupKFold(). (issue 1108)JackStat/ModelMetrics#30. (issue 1105)train now removes duplicate models in the tuning grid.
Duplicates could occur for models with discrete parameters.sample in R >= 3.6.sbf, gafs, and safs now
accept recipes as inputs. A few sections of documentation were added to
the bookdown siteggplot.gafs and
ggplot.safs were added.learning_curve_dat now has a real name.earth and ctree models were udpdate to
fix bugs (issue
1022)(issue
1018).plot.resamples and ggplot.resamples now
produce an estimate and missing values for the intervals (instead of
failing) (issue
1007)blackboost code gained a dependency on partykit
due to changes in mboost.preProcess,
constant (i.e. zero-variance) columns are first removed to avoid errors
(issue
966).train models using weights were
updated (issue
935).thresholder (issue 938).indexFinal was used
where the recipe that was saved was created using the entire training
set (issue
928).varImp in lm (issue 858) and in
bartMachine were fixed by hadjipantelis.ggplot method for resamples that
produces confidence intervals.hadjipantelis added some fixes for mxnet
models (issue
887).keras and mxnet models have better
initialization of parameters pr 765drop = FALSE bug that occurred when computing
class probabilities (issue 849).multinom
and one observation was fixed (issue 827).mlpML and mlpWeightDecayML now
ignore layers with zero units. For example, if the number of layers was
specified to be c(5, 0, 3) a warning is issued and the
architecture is converted to c(5, 3) (issue 829).svmLinearWeights2 and svmLinear3 may have
chosen the incorrect SVM loss function. This was found by Dirk Neumann
(issue
826)awtan and awnb were updated since they
previously used deprecated functions. All bnclassify
models now require version 0.3.3 of that package or greater (issue 815).confusionMatrix.default not requires data
and reference to be factors and will throw an error
otherwise. Previously, the vectors were converted to factors but this
resulted in too many bug reports and misuse.xyplot.resample did not pass the dots to the underlying
plot function (issue 853).xgbDART was fixed by
hadjipantelis.train will not load the package
(but will load the namespace). There are some exceptions where this is
not possible, including bam, earth,
gam, gamLoess, gamSpline,
logicBag, ORFlog, ORFpls,
ORFridge, ORFsvm, plsRglm,
RSimca, rrlda, spikeslab, and
others. These are noted in ?models and in the model code
itself. The regression tests now catch these issues.ranger and Rborist was added by
hadjipantelis (issue 732).GFS.GCCL was removed from the
model library.dda and
rlda) where the class probability values were reversed. (issue 761).keras models now clear the session prior to each
model fit to avoid problems. Also, on the last fit, the model is
serialized so that it can be used between sessions. The
predict code will automatically undo this encoding so that
the user does not have to manually intervene.twoClassSummary was fixed that prevents
failure when the class level includes “y” (issue 770).preProcess function can now scale variables to a
range where the user can set the high and low values (issue 730).
Thanks to Sergey Korop.train was run
using some parallel processing backends (e.g. doFuture and
doAzureParallel) (issue 748).twoClassSim
when irrelevant variables were generated. (issue 744).hadjipantelis added the DART model (aka “Dropouts meet
Multiple Additive Regression Trees”) with the model code
xgbDART (issue 742).predict.dummyVars to run
faster with large datasets with many factors (issue 727).spatialSign now has the option of removing missing data
prior to computing the norm (issue 789).glm models (issue 779).mxnet were added; mxnet (optimiser: SGD)
and mxnetAdam (optimiser: ADAM).train so that recipes
can be used to specify the model terms and preprocessing. Alexis Sardá
provided a great deal of help converting the bootstrap optimism code to
the new workflows. A new chapter was added to the package website
related to recipes.car package.train
has been harmonized with the other resampling methods in terms of fault
tolerance and prediction trimming.train now uses different random numbers to make
resamples. Previously, setting the seed prior to calling
train should result in getting the same resamples. However,
if train loaded or imported a namespace from another
package, and that startup process used random numbers, it could lead to
different random numbers being used. See (issue 452) for
details. Now, train gets a separate (and more reproducible)
seed that will be used to generate the resamples. However, this may
effect random number reproducibility between this version and previous
versions. Otherwise, this change should increase the reproducibility of
results.postResample and defaultSummary by
hadjipantelis. The function is now exposed to the users. (issue 657).multiClassSummary (issue 697).ggplot method for lift objects (and fixed a bug
in the lattice version of the code) for (issue 656).predict.dummyVars (issue 727).ordinalNet was updated for recent
changes to that package.oblique.tree was removed from the model library.K.AdaBag and
AdaBoost.M1 were changed; the number of iterations in the
default grids have been lowered.splitrule) that can be used
to change the splitting procedure and includes extremely randomized
trees. This requires version 0.8.0 of the ranger
package. (issue
581)thresholder was added to analyze the
resample results for two class problems to choose an appropriate
probability cutoff a la https://topepo.github.io/caret//using-your-own-model-in-train.html#Illustration5
(issue
224).tensorflow/keras were added.
mlpKerasDecay uses standard weight decay while
mlpKerasDropout uses dropout for regularization. Both use
RMSProp optimizer and have a lot of tuning parameters. Two additional
models, mlpKerasDecayCost and
mlpKerasDropoutCost, are classification only and perform
cost-sensitive learning. Note that these models will not run in parallel
using caret’s
parallelism and also will not give reproducible results from run-to-run
(see https://github.com/rstudio/keras3/issues/42).gamma) was modified in the
mlpSGD model code.glm.nb that was found by jpclemens0
was fixed (issue
688).xyf for
regression models.rpartCost related to how the tuning
parameter grid was processed.trainControl, if repeats is used on
methods other than "repeatedcv" or
"adaptive_cv", a warning is issued. Also, for method other
than these two, a new default (NA) is given to
repeats. (issue 720).rfFuncs now computes importance on the first and last
model fit. (issue
723)groupKFold) was added (issue 540).glm, glm.nb, and lm
variable importance methods that occur when a single variable is in the
model (issue
543).filterVarImp was fixed where the ROC curve AUC
could be much less than 0.50 because the directionality of the predictor
was not taken into account. This will artificially increase the
importance of some non-informative predictors. However, the bug might
report the AUC for an important predictor to be 0.20 instead of 0.80 (issue 565).multiClassSummary now reports the average F score (issue 566).RMSE and R2 are now (re)exposed to the
users (issue
563).glmboost,
gamboost, and blackboost models incorrectly
reported the class probabilities (issue 560).xgbTree
model by schistyakov.LiblineaR::LiblineaR) using L1 or L2 regularization were
added by hadjipantelis.predict method behaves
well when a variable is subtracted from a model formula from (issue 574).class2ind function
((issue
592)).dummyVars man file.?trainControl about using custom
resampling methods ((issue 584)).bdk model is no longer available and the code
behind the xyf model has changes substantially (including
the tuning parameters). Also, when using xyf, a check is
conducted to make sure that a recent version of the kohonen
package is being used.xgbTree and xgbLinear to help
with sparse matrix inputs for (issue 593).
Sparse matrices are not allowed when preprocessing or subsampling are
used.simpls, widekernelpls, or
kernelpls). Now, the PLSDA model estimation method is
consistent with the method requested ((issue 610)).method = "msaenet")
for (issue
561).train, x is now required to have column
names.MASS:::glm.nb) were added (issue 476)mnLogLoss now returns a named vector ((issue 514), bug
found by Jay Qi)preProcess (issue 56)train does a better job of respecting the original
format of the input data (issue 474)bdk and xyf models was fixed
where the appropriate number of parameter combinations are tested during
random search.rfe was fixed related to neural networks found
by david-machinelearning (issue 485)method = "mlpSGD") was adapted for classification and a
variable importance calculation was added."glmnet_h2o" and
"gbm_h2o". These methods are not currently optimized. (issue 283)WM, SLAVE,
SBC, HYFIS, GFS.THRIFT,
GFS.LT.RS, GFS.GCCL,
GFS.FR.MOGUL, FS.HGD, FRBCS.W,
FRBCS.CHI, FIR.DM, FH.GBML,
DENFIS, and ANFIS) were modified so that the
user can pass in the predictor ranges using the range.data
argument to those functions. (issue 498)preProcess now has an option to filter out highly
correlated predictors.trainControl now has additional options to modify the
parameters of near-zero variance and correlation filters. See the
preProcOptions argument.rotationForest and rotationForestCp
methods were revised to evaluate only feasible values of the
parameter K (the number of variable subsets). The
underlying rotationForest function reduces this parameter
until values of K divides evenly into the number of
parameters.skip option from createTimeSlices was
added to trainControl (issue 491)xgb.train’s option subsample was added to
the xgbTree model (issue 464)prSummary that is analogous to
twoClassSummary. Also, confusionMatrix gains
an argument called mode that dictates what output is
shown.rlm and lm schistyakov
added the ability to tune over the intercept/no intercept model.bam in mgcv)
was added (issue
453)svmLinear3 and
svmLinearWeights2 ((issue 441))tau parameter was added to all of the least square
SVM models ((issue
415))scat) on animal droppings was
added.na.action when the default was
set to na.fail (issue 461). This
means that train will now immediately fail if there are any
missing data. To use imputation, use na.action = na.pass
and the imputation method of your choice in the preProcess
argument. Also, a warning is issued if the user asks for imputation but
uses the formula method and excludes missing data in
na.actionmethod = "ctree2"
does not fix mincriterion = 0 and tunes over this
parameter. For a fixed depth, mincriterion can further
prune the tree (issue 409).train tries
harder to respect the original class of the outcome. For example, if an
ordered factor is used as the outcome with a modeling function that
treats is as an unordered factor, the model still produces an ordered
factor during prediction.ranger code now allows for case weights (issue 414).twoClassSim now has an option to compute ordered
factors.method = "hdrda",
method = "rlda", and method = "dda",
respectively) (issue 313).mlpSGD.rpartScore (from the rpartScore
package), ordinalNet (ordinalNet),
vglmAdjCat (VGAM),
vglmContRatio (VGAM),
and vglmCumulative (VGAM).
Note that, for models that load VGAM,
there is a conflict such that the predictors class code
from caret
is masked. To use that method, you can use
caret:::predictors.train() instead of
predictors().method = "Rborist" (issue 418)print.train was fixed when LOO CV was used (issue 435)method = "svmLinear2") had the gamma
parameter for the RBF kernel removed.print.train no longer shows the standard deviation of
the resampled values unless the new option is used
(print.train(, showSD = TRUE)). When shown, they are within
parentheses (e.g. “4.24 (0.493)”).cforest module’s oob element was
modified based on another bug found by Alexis Sarda (issue 351).bagEarth, bagEarthGCV,
bagFDA, bagFDAGCV, earth,
fda, and gcvEarth models have been updates so
that case-weights can be used.rda module contained a bug found by Eric Czech (issue 369).data(Sacramento)) with sale
prices of homes.method = "adaboost" from
the fastAdaboost
package) was added (issue 284).method = "deepboost"
from the deepboost
package) was added (issue 388).train, rfe, and sbf objects that
more rationally normalizes the resampled tables (issue 355).xgbLinear (issue 372).predict.train to error trap
(and fix) cases when predictions are requested without referencing a
newdata object (issue 347).glmboost (and gamboost) related to the
mstop function modifying the model object in memory. It was
fixed (issue
396).indexFinal, was added to
trainControl.dummyVars related to the
names of the resulting data set.rknn and rknnBel were removed since
their package is no longer on CRAN.method = "manb") from the
bnclassify
package was added.blackboost was updated to work with outcomes with 3+
classes.rpart1SE was added. This has no tuning
parameters and resamples the internal rpart
procdure of pruning using the one standard error method.svmRadialSigma) tunes over the cost
parameter and the RBF kernel parameter sigma. In the latter case, using
tuneLength will, at most, evaluate six values of the kernel
parameter. This enables a broad search over the cost parameter and a
relatively narrow search over sigma.checkConditionalX
function for details. This is only used for classification. (issue 334)DummyVars (issue 344)pythonKnnReg
for an example. This also removes the overall package dependency on rPython
(issue
328).enpls and
enpls.fs were changed to avoid errors.nearZeroVar functionvarImp for glmnet
models so that they return the absolute value of the regression
coefficients (issue
173) (issue
190)method = "nb") gained a
tuning parameter, adjust, that adjusts the bandwidth (see
?density). The parameter is ignored when
usekernel = FALSE.blasso creates
predictions using the mean of the posterior distributions but sets some
parameters specifically to zero based on the tuning parameter called
sparsity. For example, when sparsity = .5,
only coefficients where at least half the posterior estimates are
nonzero are used. The other model, blassoAveraged, makes
predictions across all of the realizations in the posterior distribution
without coercing any coefficients to zero. This is more consistent with
Bayesian model averaging, but is unlikely to produce very sparse
solutions.cv.spikeslab where the tuning variable is the number of
retained predictors.xgbTree models.svmRadialWeights was updated to allow for class
probabilities. Previously, kernlab
did not change the probability estimates when weights were used.varImp.train was added (issue 231)fjeze added new models mlpML
and mlpWeightDecayML that extend the existing RSNNS
models to multiple layers. fjeze also added the
gamma parameter to the svmLinear2 model.preProcess can now remove predictors using zero- and
near zero-variance filters via (method values of
"zv" and "nzv"). When used, these filters are
applied to numeric predictors prior to all other pre-processing
operations.train now throws an error for classification tasks
where the outcome has a factor level with no observed data (issue 260).train are not converted to
factors.gbm models when a single multinomial observation is
predicted (issue
274).ggplot.train was added that highlights
the optimal tuning parameter setting in the cases where grid search is
used (thanks to Balaji Iyengar (github: bdanalytics)).trainControl, the argument
savePredictions can now be character values
("final", "all" or "none").
Logicals can still be used and match to "all" or
"none".preProcess now allows (but ignores) non-numeric
predictor columns.snn and
ownnmethod = "ranger")rotationForest2) that also tunes over cp.
Unfortunately, the sub-model trick can’t be utilized in this
instance.dwdLieanr, dwdPoly, and
dwdRadial)rfe when train was
used to generate a classification model but class probabilities were not
(or could not be) generated (issue 234).sklearn.neighbors.KNeighborsRegressor that can be accessed
via train using the rPython
package. The python modules sklearn and pandas
are required for this to run.lift and missing values (issue 225). This
was fixed such that missing values are removed prior to the calculations
(within each model)LPH07_1 so that two
class data can also be simulated and predictors are converted to
factors."nbDiscrete" and "tan"), models using
attribute weighting ("awnb" and "awtan"), and
wrappers that use search methods to optimize the network structure
("nbSearch" and "tanSearch"). In each case,
the predictors and outcomes must all be factor variables; for that
reason, using the non-formula interface to train
(e.g. train(x, y)) is critical to preserve the factor
structure of the data.multiClassSummary was added to
compute performance values for problems with three or more classes. It
works with or without predicted class probabilities (issue 107).confusionMatrix was modified to deal with name
collisions between this package and RSNNS
(issue
256).preProcess for ICA and PCA was fixed.avNNet and pcaNNet when predicting
class probabilities were fixed (issue
#261).rfRules was added. A basic random forest
model is used and then is decomposed into rules (of user-specified
complexity). The inTrees
package is used to prune and optimize the rules. Thanks to Mirjam Jenny
who suggested the workflow.bartMachine (bartMachine),
rotationForest (rotationForest),
sdwd (sdwd),
loclda (klaR),
nnls (nnls),
svmLinear2 (e1071),
rqnc (rqPen),
and rqlasso (rqPen)method = "custom" can be used with
trainControl for better printing.avNNet when
bag = TRUEruggerorossi in
method = "dnn" with classification.sampling was added to
trainControl that allows users to subsample their data in
the case of a class imbalance. Another help
page was added to explain the features.extraTrees
models now.trace.class2ind) that can be used to
make dummy variables for a single factor vector is now documented and
exported.xyplot.lift where the reference
line was incorrectly computed. Thanks to Einat Sitbon for finding
this.EdwinTh developed a faster version of
findCorrelation and found a bug in the original code.
findCorrelation has two new arguments, one of which is
called exact which defaults to use the original (fixed)
function. Using exact = FALSE uses the faster version. The
fixed version of the “exact” code is, on average, 26-fold slower than
the current version (for 250x250 matrices) although the average time for
matrices of this size was only 26s. The exact version yields subsets
that are, one average, 2.4 percent smaller than the other versions. This
difference will be more significant for smaller matrices. The faster
(“approximate”) version of the code is 8-fold faster than the current
version.slyuee found a bug in the gam
model fitting code.bartMachine variable
importance code.xgbTree amd xgbLinear from the
xgboost package were added. That package is not on CRAN and
can be installed from github using the devtools
package and
install_github('dmlc/xgboost',subdir='R-package').dratewka enabled rbf models for
regression.mnLogLoss was added.preProces objects that used
bagged imputation was reduced almost 5-fold.trainControl called trim
was added where, if implemented, will reduce the model’s footprint.
However, features beyond simple prediction may not work.gbm model code was fixed
(thanks to Wade Cooper)splom.resamples now respects the models
argumentlift called cuts was
added to allow more control over what thresholds are used to calculate
the curve.cuts argument of calibration now
accepts a vector of cut points.dummyVarsavNNet, bagFDA, icr,
knn3, knnreg, pcaNNet, and
plsda.createTimeSlices to thin the
number of resampleslrFuncs,
lmFuncs, and gamFuncs were updated so that
rfe accepts a matrix x argument.train and
glmnet, an initial glmnet fit is created with
alpha = 0.50 to define the lambda values.train models for "gbm",
"gam", "gamSpline", and
"gamLoess" now allow their respective arguments for the
outcome probability distribution to be passed to the underlying
function.print.varImp.train was fixed.train now returns an additional column called
rowIndex that is exposed when calling the summary function
during resampling.rpartCost model since they are unlikely to agree with the
class predictions.extractProb no longer redundantly calls
extractPrediction to generate the class predictions.var_seq was added that finds a
sequence of integers that can be useful for some tuning parameters such
as random forests mtry. Model modules were update to use
the new function.n.minobsinnode was added as a tuning parameter to
gbm models.train now
properly checks the metric argument against the names of
the measured outcomes.createDataParition and createFolds
were modified to better handle cases where one or more class have very
low numbers of data points.gafs and
safs were added, along with helper functions and objects,
were added. The package HTML was updated to expand more about feature
selection.AdaBag and
AdaBoost.M1.bagFDAGCV and bagEarthGCV) were added that use
the GCV statistic to prune the model. This leads to memory reductions
during training.ada had a bug fix applied and the
code was adapted to use the “sub-model trick” so it should train
faster.traindrop = FALSE bug was fixed in
getTrainPerftrain, the argument last was being
incorrectly set for the last model.findCorrelation to make
it faster.print.train when the bootstrap 632 estimate is used.train using method = "polr" from MASSLPH07_1 now encodes the noise variables as binaryrfe and sbf get arguments for
indexOut for their control functions.nearZerVar based on code from
Michael Benesty was added the old version is now called nzv
that uses less memory and can be used in parallel.gbm with Poisson data was fixed (thanks to
user eriklampa)sbfControl now has a multivariate option
where all the predictors are exposed to the scoring function at
once.compare_models was added that is a simple
comparison of models via diff.resamples).variables component of
rfe objects were simplified.bag
would not run in parallel.predictionBounds was not implemented during
resampling.preProcess were made related to KNN
imputation.dnn models were fixed.generateExprVal.method.trimMean,
normalize.AffyBatch.normalize2Reference,
normalize2Reference, and PLS. The original
code and the man files can be found at https://github.com/topepo/caret-archive/tree/main/deprecated.x to train, we now
respect the class of the input value to accommodate other data types
(such as sparse matrices). There are some complications though; for
pre-processing we throw a warning if the data are not simple matrices or
data frames since there is some infrastructure that does not exist for
other classes( e.g. complete.cases). We also throw a
warning if returnData <- TRUE and it cannot be converted
to a data frame. This allows the use of sparse matrices and text corpus
to be used as inputs into that function.plsRglm was added.ANFIS,
DENFIS, FH.GBML, FIR.DM,
FRBCS.CHI, FRBCS.W, FS.HGD,
GFS.FR.MOGAL, GFS.GCCL, GFS.LTS,
GFS.THRIFT, HYFIS, SBC and
WM. Thanks to Lala Riza for suggesting these and
facilitating their addition to the package.svmBoundrangeString, svmExpoString,
svmSpectrumStringupdate.rfe was added.cluster.resamples was added to the namespace.metric was added to
summary.resamples.prcomp.resamples now passed ... to
prcomp. Also the call to prcomp uses the
formula method so that na.action can be used.resamples was enhanced so that
train and rfe models that used
returnResamp="all" subsets the resamples to get the
appropriate values and issues a warning. The function also fills in
missing model names if one or more are not given.SLC14_1, SLC14_2, LPH07_1 and
LPH07_2print.train was re-factored so that
format.data.frame is now used. This should behave better
when using knitr.train.formula was improved to
provide more helpful feedback in cases where there is at least one
missing value in each row of the data set.ggplot.train was modified so that groups are
distinguished by color and shape.plot.train and
ggplot.train called nameInStrip that will
print the name and value of any tuning parameters shown in panels.preProcess.trainControl for
adaptive models was filled in.plot.train and
ggplot.train to note that the relationship between the
resampled performance measures and the tuning parameters can be
deceiving when using adaptive resampling.trainControl to make sure that a
value of min makes sense when using adaptive
resampling.train
was added back into the package. See ?models.varImp for pamr models was
updated to clarify the ordering of the importance scores.getModelInfo was updated to generate a more informative
error message if the user looks for a model that is not in the package’s
model library.train."parRF" (parallel random forest) was added
back into the library.train, the hold-out
weights are exposed when computing the summary function.data.table given to
train to a data frame.train if
there are no rows in the data (changes suggested by Andrew Ziem)rfe was found where the largest subset size
have the same results as the full model. Thanks to Jose Seoane for
reporting the bug.rfe that occurred when LOO CV was
used.tuneGrid contained only a single model.trainControl now has a method = "none"
resampling option that bypasses model tuning and fits the model to the
entire training set. Note that if more than one model is specified an
error will occur.logicForest models were removed since the package is
now archived.CSimca and RSimca models from the rrcovHD
package were added.elm from the elmNN
package was added.rknn and rknnBel from the rknn
package were addedbrnn from the brnn
package was added.panel.lift2 and xyplot.lift now have an
argument called values that show the percentages of samples
found for the specified percentages of samples tested.train, rfe and sbf should no
longer throw a warning that “executingggplot method for train was added.preProcess by
Zachary Mayer.rpart models. Previously,
when the final model is determined, it would be fit by specifying the
model using the cp argument of rpart.control.
This could lead to duplicated Cp values in the final list of possible Cp
values. The current version fits the final model slightly different. An
initial model is fit using cp = 0 then it is pruned using
prune.rpart to the desired depth. This shouldn’t be
different for the vast majority of data sets. Thanks to Jeff Evans for
pointing this out.ksvm and
rvm does the estimation.returnResamp in
rfeControl and sbfControl is now
returnResamp = "final".cluster was added as a general class with a specific
method for resamples objects.spatialSign was fixed for data frames with a
single column.rfe to truncate the subset sizes
in case the user over-specified them.gamFuncs for the rfe
function.trainControl, rfeControl and
sbfControl were added so that the user can set the seed at
each resampling iteration (most useful for parallel processing). Thanks
to Allan Engelhardt for the recommendation.predict.train now has an explicit
na.action argument defaulted to na.omit. If
imputation is used in train, then
na.action = na.pass is recommended.dummyVars that occurred when missing
data were in newdata. The function contr.dummy
is now deprecated and contr.ltfr should be used (if you are
using it at all). Thanks to stackexchange user mchangun for finding the
bug.dummyVars when
levelsOnly = TRUE to see if any predictors share common
levels.fullRank was added to
dummyVars. When true, contr.treatment is used.
Otherwise, contr.ltfr is used.train was fixed with gbm models
(thanks to stackoverflow user screechOwl for finding it).protoclass function in the protoclass
package was added. The model uses a distance matrix as input and the
train method also uses the proxy
package to compute the distance using the Minkowski distance. The two
tuning parameters is the neighborhood size (eps) and the
Minkowski distance parameter (p).train. The problem is that the
methods package was not being loaded in the workers. While
reproducible, it is unknown why this occurs and why it is only for some
technologies and systems. The methods package is now a
formal dependency and we coerce the workers to load it remotely.rpart, C5.0 and ksvm,
cost-sensitive versions of these models for two classes were added to
train. The method values are rpartCost,
C5.0Cost and svmRadialWeights.ksvm models was changed.
There are some cases where the class predictions and the predicted class
probabilities disagree. This usually happens when the probabilities are
close to 0.50 (in the two class case). A kernlab
bug has been filed. In the meantime, if the ksvm model uses
a probability model, the class probabilities are generated first and the
predicted class is assigned to the probability with the largest value.
Thanks to Kjell Johnson for finding that one.print.train was changed so that tune parameters that
are logicals are printed well.rfe.twoClassSim was added for benchmarking
classification models.predict.nullModel related to
predicted class probabilities.getTrainPerf was made visible.sda models from the sda
package was changed to include lambda.randomForests is used with train and
tuneLength == 1, the randomForests default
value for mtry is used.Mlda)
and factor-based linear discriminant analysis (RFlda) from
the HiDimDA
package were added to train.preProcess function.train bug was fixed for the rrlda model
(found by Tiago Branquinho Oliveira).extraTrees model in the extraTrees
package was added.kknn.train model in the kknn
package was added.lrFuncs where the class threshold
was improperly set (thanks to David Meyer).getTrainPerf was finally made
visible.sda:::sda models was changed to
add the lambda parameter.predictors.earth, discovered by Katrina
Bennett, was fixed.lift can compute gain and lift charts (and defaults to
gain)train defaults to keepX = FALSE to
save space. Pass in keepX = TRUE to use out-of-bag sampling
for this model.prob.model will default to the value of
classProbs in the trControl function. If
prob.model is passed in as an argument to
train, this specification over-rides the default. In other
words, to avoid generating a probability model, set either
classProbs = FALSE or prob.model = FALSE.bayesglm from the arm
package.bag, thanks to Keith Woolner.
Most notably, out-of-bag estimates are now computed when the prediction
function includes a column called pred.bag and
avNNet, which can be turned off using an optional
arguments.train, rfe, sbf,
bag and avNNet were given an additional
argument in their respective control files called
allowParallel that defaults to TRUE. When
Code, the code will be executed in parallel if a parallel
backend (e.g. doMC)
is registered. When allowParallel = FALSE, the parallel
backend is always ignored. The use case is when rfe or
sbf calls train. If a parallel backend with P
processors is being used, the combination of these functions will create
P^2 processes. Since some operations benefit more from parallelization
than others, the user has the ability to concentrate computing resources
for specific functions.createTimeSlices was
contributed by Tony Cooper that generates cross-validation indices for
time series data.trainControl.
initialWindow, horizon and
fixedWindow are applicable for when
method = "timeslice". Another, indexOut is an
optional list of resampling indices for the hold-out set. By default,
these values are the unique set of data points not in the training
set.glmnet models when
generating class probabilities (thanks to Bradley Buchsbaum for finding
it).na.action was not being
properly set with train.formula().parallel.resamples was changed to properly account for
missing values.probFunction and
predictionFunction.sbf exposed by a new version of plyr.parallel.resamples function was changed to
parallelplot.resamples.ksvm now allows probabilities when class weights
are used, the default behavior in train is to set
prob.model = TRUE unless the user explicitly sets it to
FALSE. However, I have reported a bug in ksvm
that gives inconsistent results with class weights, so this is not
advised at this point in time.predict.bagEarth and
predict.bagFDA.rfeControl(saveDetails = TRUE) or
sbfControl(saveDetails = TRUE) an additional column is
added to object$pred called rowIndex. This
indicates the row from the original data that is being held-out.NA values in SVM model
predictions.scrda methods were removed from the package (on
6/30/12, R Core sent an email that “since we haven’t got fixes for long
standing warnings of the rda packages since more than half a year now,
we set the package to ORPHANED.”)C5.0, C5.0Tree and
C5.0Rules).train with NaiveBayes when
fL != 0 was usedtrain with
verboseIter = TRUE was modified to show the resample label
as well as logging when the worker started and stopped the task (better
when using parallel processing).downSample for class
imbalancesupSample function was added for class
imbalances.icr.formula that was so
ridiculous, I now know that nobody has ever used that function.method = "oob" with
trainplot.train so that some
tuning parameters are better labeled.dotplot.resamples and bwplot.resamples now
order the models using the first metric.resamples class were
changed such that when only one metric is shown: the strip is not shown
and the x-axis label displays the metrictrainControl(savePredictions = TRUE) an
additional column is added to object$pred called
rowIndex. This indicates the row from the original data
that is being held-out.nnet objects was
created based on Gevrey, M., Dimopoulos, I., & Lek, S. (2003).
Review and comparison of methods to study the contribution of variables
in artificial neural network models. ecological modelling, 160(3),
249–264.predictor function for glmnet was
update and a variable importance function was also added.predict.avNNet that was
fixed.sensitivity and specificity were given an
na.rm argument.train.
If a model fit fails, the predictions are set to NA and a
warning is issued (eg “model fit failed for Fold04: sigma=0.00392,
C=0.25”). When verboseIter = TRUE, the warning is also
printed to the log. Resampled performance is calculated on only the
non-missing estimates. This can also be done during predictions, but
must be done on a model by model basis. Fault tolerance was added for kernlab
models only at this time.lift was modified in two ways. First, cuts
is no longer an argument. The function always uses cuts based on the
number of unique probability estimates. Second, a new argument called
label is available to use alternate names for the models
(e.g. names that are not valid R variable names).print.bag was fixed.ctree and
cforest to avoid conflicts between duplicate function names
in the party
and partykit
packagelrFuncs) was added.train with method="glmStepAIC"
was fixed so that direction and other stepAIC
arguments were honored.preProcess where the number of ICA
components was not specified. (thanks to Alexander Lebedev)train. (thanks to Alexander Lebedev)ctree, cforest and custom models.lda2, which tunes by the number of
functions used during prediction.predict.train allows probability predictions for custom
models now (thanks to Peng Zhang)confusionMatrix.train was updated to use the default
confusionMatrix code when norm = "none" and
only a single hold-out was used.?train was changed to be more
readableRRF uses a penalty for each predictor based on the
scaled variable importance scores from a prior random forest fit.
RRFglobal sets a common, global penalty across all
predictors.krlsRadial and krlsPoly. Both have
kernel parameters (sigma and degree) and a
common regularization parameter lambda. The default for
lambda is NA, letting the krls
function estimate it internally. lambda can also be
specified via tuneGrid.twoClassSummary was modified to wrap the call to
pROC:::roc in a try command. In cases where
the hold-out data are only from one class, this produced an error. Now
it generates NA values for the AUC when this occurs and a
general warning is issued.train were modified so
that missing values for performance measures would not throw an error
(but will issue a warning).mlp, mlpWeightDecay,
rbf and rbfDDA were added from RSNNS.roc, rocPoint and
aucRoc finally met their end. The cake was a lie.lift was expanded into lift.formula for
calculating the plot points and xyplot.lift to create the
plot.match.call changes were made to pass new R CMD
check tests.calibration, calibration.formula and
xyplot.calibration were created to make probability
calibration plots.xyf and bdk from the kohonen
package were added.update.train was added so that tuning parameters can be
manually set if the automated approach to setting their values is
insufficient.method = "pls" in train, the
plsr function used the default PLS algorithm (“kernelpls”).
Now, the full orthogonal scores method is used. This results in the same
model, but a more extensive set of values are calculated that enable VIP
calculations (without much of a loss in computational efficient).preProcess to ensure valid values
of method were used.kernelpls, was added.residuals and summary methods were added
to train objects that pass the final model to their
respective functions.roc was found when the classes were completely
separable.twoClassSummary and
filterVarImp were changed to use the pROC
package. This, and other changes, have increased efficiency. For
filterVarImp on the cell segmentation data lead to a
54-fold decrease in execution time. For the Glass data in the mlbench
package, the speedup was 37-fold. Warnings were added for
roc, aucRoc and rocPoint
regarding their deprecation.plsda models were used
with class probabilitiesglmnet function was updated to
return a character vector. Because of this, train required
modification and a version requirement was put in the package
description file.gbm
models.metric = "ROC" and classProbs = FALSE.train obtained
earth class probabilitiestrain (functions in the caret namespace cannot be
found).pickSizeTolerance that was
fixed.rfesaveDetails = TRUE in sbfControl or
rfeControl will save the predictions on the hold-out sets
(Jiaye Yu wins the prize for finding that one).trainControl now has a logical to save the hold-out
predictions.type = "prob" was added for avNNet
prediction.train and (it appears that) multicore
is being used for parallel processing. The session will crash, so don’t
do that.predict.train but not in extractPrediction.
Thanks to Antoine Stevens for finding this.predict.mvr since the pls
package now has a namespace.train is included.
The “caretTrain” vignette was updated with a new section that defines
how to make custom models.train bug of the last version was
not entirely squashed. Now it is.panel.lift was moved out of the examples in
?lift and into the package along with another function,
panel.lift2.lift now uses panel.lift2 by defaultevtree from evtreetrain could failtrain did not occur for the final
model fitlift, was added to create lattice objects
for lift plots.simpls and
widekernelpls. These are new models since both
train and plsr have an argument called
method, so the computational algorithm could not be passed
through using the three dots.rpart was added that uses cp as the
tuning parameter. To make the model codes more consistent,
rpart and ctree correspond to the nominal
tuning parameters (cp and mincriterion,
respectively) and rpart2 and ctree2 are the
alternate versions using maxdepth.ctree‘s tuning parameter was changed to ’1
- P-Value Threshold’controls was not being properly passed
through in models ctree and ctree2.controls was not being set properly for
cforest models in traintrain, rfe and
sbf did not recognize LOOCVavNNet sometimes failed with categorical outcomes with
bag = FALSEpreProcess was fixed that was triggered by
matrices without dimnames (found by Allan Engelhardt)cforest was using the argument control
instead of controlsslda,
hdda, glmStepAIC, nodeHarvest,
avNNet and sdatrain, rfe and
sbf. Their respective man pages have been revised to
illustrate this change.defaultSummary
were changed so that the ROC AUC is firsttrainControl, rfeControl and
sbfControl are now defaulted to FALSErfe now returns the variable ranks in a single data
frame (previously there were data frames in lists of lists) for each of
use. This will will break code from previous versions. The built-in RFE
functions were also modifiedrfe and sbf
were addedpreProcess are no longer
allowedmethod = 'ridge') based on enet.createFolds is
trying to randomize n/4 numeric samples to k
folds. With less than 40 samples, it could not always do this and would
generate less than k folds in some cases. The change will
adjust the number of groups based on n and k.
For small samples sizes, it will not use stratification. For larger data
sets, it will at most group the data into quartiles.confusionMatrix.train was added to get an
average confusion matrices across resampled hold-outs when using the
train function for classification.avNNet, that fits several neural
networks via the nnet
package using different seeds, then averages the predictions of the
networks. There is an additional bagging option.bag was
changed.train to
preProcess. The trainControl function was
re-factored and several options (e.g. k,
thresh) were combined into a single list option called
preProcOptions. The default is consistent with the original
configuration:
preProcOptions = list(thresh = 0.95, ICAcomp = 3, k = 5)preProcess. The
pcaComp option can be used to set exactly how many
components are used (as opposed to just a threshold). It defaults to
NULL so that the threshold method is still used by default,
but a non-null value of pcaComp over-rides
thresh.train, the call for
preProcess is now modified to be a text string (“scrubed”)
because the call could be very large.applyProcessing and
processData.segmentationData for location). First, several discrete
versions of some of the predictors (with the suffix
"Status") were removed. Second, there are several skewed
predictors with minimum values of zero (that would benefit from some
transformation, such as the log). A constant value of 1 was added to
these fields: AvgIntenCh2, FiberAlign2Ch3,
FiberAlign2Ch4, SpotFiberCountCh4 and
TotalIntenCh2.plot.train in a effort to get
the group key to look less horrid.train, rfe and sbf are now
able to estimate the time that these models take to predict new samples.
Their respective control objects have a new option,
timingSamps, that indicates how many of the training set
samples should be used for prediction (the default of zero means do not
estimate the prediction time).xyplot.resamples was modified. A new argument,
what, has values: "scatter" plots the
resampled performance values for two models; "BlandAltman"
plots the difference between two models by the average (aka a MA plot)
for two models; "tTime", "mTime",
"pTime" plot the total model building and tuning; time
("t") or the final model building time ("m")
or the time to produce predictions ("p") against a
confidence interval for the average performance. 2+ models can be
used.train using
regsubsets in the leaps
package: "leapForward", "leapBackward" and
"leapSeq". The tuning parameter, nvmax, is the
maximum number of terms in the subset.preProcess used ICA
(spotted by Allan Engelhardt)preProcess was always being called (even to do nothing)
(found by Guozhu Wen)"M5" that combines M5P and M5Rules
from the RWeka
package. This new model uses either of these functions depending on the
tuning parameter "rules".train and
method = "penalized". Thanks to Fedor for finding it.M5Rules
controlling smoothing.varImp.RandomForest was updated to work. It now
requires a recent version of the party
package.trainControl was added to allow users
to constrain the possible predicted values of the model to the range
seen in the training set or a user-defined range. One-sided ranges are
also allowed.print.rfe and print.sbf
(thanks to Jan Lammertyn)dummyVars failed with formulas using "."
(all.vars does not handle this well)tree2 was failing for some classification modelsclass.weights, the options prob.model is
automatically set to FALSE (otherwise, it is always set to
TRUE). A warning is issued that the model will not be able
to create class probabilities.svmRadialCost, that fits the SVM
model and estimates the sigma parameter for each resample
(to properly capture the uncertainty).preProcess has a new method called "range"
that scales the predictors to [0, 1] (which is approximate for new
samples if the training set ranges is narrow in comparison).train to make sure that, when the
user passes a data frame to tuneGrid, the names are correct
and complete.print.train prints the number of classes and levels for
classification models.train,
rfe and sbf as well as the fit time of the
final model. These are stored in an element called “times”.plot.train was pretty much re-written to more
effectively use trellis theme defaults and to allow arguments (e.g. axis
labels, keys, etc) to be passed in to over-ride the defaults.print.train when preProc is
NULLpredict.BoxCoxTrans would go all klablooey if there
were missing valuesvarImp.rpart was failing with some models (thanks to
Maria Delgado)preProcess.plot.train when a
transformation is applied for models with three tuning parameters.train object with
method == "gbm" and multiple values of the shrinkage
parameter, the ordering of panels was improved.partDSA and
qrf.extractPrediciton with a single predictor was also
fixed.'gcvEearth' which is the basic MARS model. The pruning
procedure is the nominal one based on GCV; only the degree is tuned by
train.'qrnn' for quantile regression neural networks from the
qrnn
package.'Boruta' for random forests models with feature
selection via the Boruta
package.print.train: the call is not
automatically printed (but can be when print.train is
explicitly invoked); the “Selected” column is also not automatically
printed (but can be); non-table text now respects
options("width"); only significant digits are now printed
when tuning parameters are kept at a constant valuepreProcess related to complete.cases and a
single predictor.rfe with gam
was added.bag so that, for
classification models, each class has the same number of classes as the
smallest class.dummyVars, that creates an entire
set of binary dummy variables (instead of the reduced, full rank set).
The initial code was suggested by Gabor Grothendieck on R-Help. The
predict method is used to create dummy variables for any data set.R2 and RMSE functions for evaluating
regression modelsvarImp.gam failed to recognize objects from mgcvfilterVarImpdiff.resamples calculated the number of
comparisons, the "models" argument was ignored.predict.bag was ignoring
type = "prob"train when class levels are not
valid R variable names.multinom objects.summary.diff.resamples.
Confidence intervals in dotplot.diff.resamples are adjusted
accordingly if the Bonferroni is used.dotplot.resamples, no point was plotted when the
upper and/or lower interval values were NaN. Now, the point is plotted
but without the interval bars.print.rfe to correctly describe new resampling
methods.predict.rfe where an error was thrown
even though the required predictors were in newdata.preProcess so that centering and scaling are
both automatic when PCA or ICA are requested.checkResamples and
checkConditionalX that identify predictor data with
degenerate distributions when conditioned on a factor.segmentedData)
from Hill et al. Impact of image segmentation on high-content screening
data quality for SK-BR-3 cells. BMC bioinformatics (2007) vol. 8 (1)
pp. 340.sbf objects were printed (when using
repeated CV) and classification models with earth
and classProbs = TRUE.predict.rfepreProcess.varImp.rfe that caused incorrect results
(thanks to Lawrence Mosley for the find).train would not allow knn
imputation.filterVarImp and roc now check for missing
values and use complete data for each predictor (instead of case- wise
deletion across all predictors).createDataPartition(... list = FALSE).train was used with
ctree or tree2 methods.rfe and sbf when running in
parallel; not all the resampling results were savedconfusionMatrix.print.train so that constant parameters are not
shown in the table (but a note is written below the table instead).
Also, the output was changed slightly to be more easily read (I
hope)varImp.gam to work with either mgcv
or gam
packages.lvq.trainControl.createMultiFolds, is used to generate
indices for repeated CV.train with the
preProcess argument. This has been tested when caret
function are used with rfe and sbf (via
caretFuncs and caretSBF, respectively).preProcess(method = "spatialSign"), centering and
scaling is done automatically too. Also, a bug was fixed that stopped
the transformation from being executed.preProcess. The RANN
package is used to find the neighbors (the knn impute function in the
impute library was consistently generating segmentation faults, so we
wrote our own).preProcess in situations where
scaling is requested but there is no variation in the predictor.
Previously, the method would fail. Now a warning is issued and the value
of the standard deviation is coerced to be one (so that scaling has no
effect).gam from mgcv
(with smoothing splines and feature selection) and gam from
gam
(with basic splines and loess) smoothers. For these models, a formula is
derived from the data where “near zero variance” predictors (see
nearZerVar) are excluded and predictors with less than 10
distinct values are entered as linear (i.e. unsmoothed) terms.glm argument with
a binomial family.varImp.multinom, which is based on the absolute
values of the model coefficientsrfe and sbf to include class
probabilities in performance calculations.train, rfe and sbf.trainControl and
twoClassSummary.modelLookup was put in the namespace and a
man file was added.varImp
for plsda and fda objects crashed.TRUElogic.bagging in logicFT with
method = "logicBag"varImp.train related to nearest shrunken
centroid models.splom.resamples so that the
variables in the scatter plots are models or metrics.dotplot.resamples plus acknowledgements to
Hothorn et al. (2005) and Eugster et al. (2008)tuneGrid option to allow a function to be
passed in.prcomp method for the resamples
classresamples to work with rfe and
sbfparallel.resamples.diff.resamples where ...
were not being passed to the test statistic function.train when running
verbose.bag function. Also, model type "hdda" from the
HDclassif
package was added.quantregForest and rda (from rda)
to train. Since there is a naming conflict with
rda from mda,
the rda
model was given a method value of "scrda".train since v 4.39 was wrongvarImp.mvr called
"estimate". In cases where the mvr model had multiple
estimates of performance (e.g. training set, CV, etc) the user can now
select which estimate they want to be used in the importance calculation
(thanks to Sophie Bréand for finding this)predict.sbf and modified the structure of the
sbf helper functions. The "score" function
only computes the metric used to filter and the filter function does the
actual filtering. This was changed so that FDR corrections or other
operations that use all of the p-values can be computed.print.confusionMatrix was changedmaxDissim so that the variable
name is returned instead of the index.hda and cleaned up the caret
training vignettestepAIC for linear models and generalized linear
modelsrocc classification and fixed a typo.dhfr and
carsroc that, for some data cases, would
reverse the “positive” class and report sensitivity as specificity and
vice-versa.train using
the foreach
package.plr
function in the stepPlr
package.sbf (for
selection by filter).rfe that did not affect the results, but
did produce a warning.nullModel, was added. This model
fits either the mean only model for regression or the majority class
model for classification.lda and
qda using the stepclass function in klaRextractProb
and extractPrediction that saves the name of the model
object so that you can have multiple models of the same type and tell
which predictions came from which model.plotClassProbs: new parameters
were added and densityplots can now be produced.caretFunc that led to NaN variable
rankings, so that the first k terms were always selected.rferfepcr as a methodtrain for models that
accept weightsnearZeroVar and updated
format.earth so that it does not automatically print the
formulanearZeroVar from Allan
Engelhardt that is much fasterextractProb (for glmnet) and
filterVarImp.train (otherwise train will set it depending
on the mode of the outcome). However, glmnet doesn’t have much support
for families at this time, so you can’t change links or try other
distributions.createFolds when the smallest y value is
more than 25 of the dataprint.trainconfusionMatrixprint.confusionMatrixrlm from MASS;
a knn regression model, knnregclassDist”) to computes the
class centroids and covariance matrix for a training set for determining
Mahalanobis distances of samples to each class centroid was addedrfe) for doing recursive feature
selection (aka backwards selection). A new vignette was added for more
detailsOneR and PART from RWekaconfusionMatrix. The
old doc had "Detection Prevalence = A/(A+B)" and the new
one has "Detection Prevalence =(A+B)(A+B+C+D)". The
underlying code was correct.lars (fraction and step
as parameters)train and bagEarth to allow
earth for classification modelscaTools::LogitBoostlapply). In this way, users can use their
own parallel processing software without new versions of caret.
Examples are given in train.train.confusionMatrix, sensitivity,
specificity and the predictive value functions: each was
made more generic with default and table methods;
confusionMatrix “extractor” functions for matrices and
tables were added; the pos/neg predicted value computations were changed
to incorporate prevalence; prevalence was added as an option to several
functions; detection rate and prevalence statistics were added to
confusionMatrix; and the examples were expanded in the help
files.qda, mda and pda.resampleHist. Also added a check in the
train functions that error trapped with glm
models and > 2 classesglms. Also, added varImp.bagEarth to
the namespace.sda from the sda
package. There was a naming conflict between sda::sda and
sparseLDA:::sda. The method value for
sparseLDA was changed from “sda” to “sparseLDA”.spls from the spls
packagesda from the sparseLDA
package (not on CRAN).penalized and
ppr)print.traingbm, let the user over-ride the default value of
the distribution argument (brought us by Peter Tait via
RHelp).predict.preProcess so that it doesn’t crash if
newdata does not have all of the variables used to
originally pre-process *unless* PCA processing was requested.varImp.rpart when the model had only
primary splits.predictors man pagepredictors that returns the
names of the predictors that were used in the final model.ppr from the stats
package.train to use custom made
performance functions so that the tuning parameters can be chosen on the
basis of things other than RMSE/R-squared and Accuracy/Kappa.trainControl called
“summaryFunction” that is used to specify the function used to compute
performance metrics. The default function preserves the functionality
prior to this new versiontrain is “maximize” which is a
logical for whether the performance measure specified in the “metric”
argument to train should be maximized or minimized.trainControl
carries the maximize argument with it so that customized performance
metrics can be used.confusionMatrix (thanks to Gabor
Grothendieck)superpc from the superpc
package. One note: the data argument that is passed to
superpc is saved in the object that results from
superpc.train. This is used later in the prediction
function.slda from ipred.JRip) and logistic model
trees from RWekaxyplot.train, densityplot.train,
histogram.train and stripplot.train. These are
all functions to plot the resampling points. There is some overlap
between these functions, plot.train and
resampleHist. plot.train gives the average
metrics only while these plot all of the resampled performance metrics.
resampleHist could plot all of the points, but only for the
final optimal set of predictors.trainControl called returnResamp which should
have values “none”, “final” and “all”. The default is “final” to be
consistent with previous versions, but “all” should be specified to use
these new functions to their fullest.predict.train and
predict.list were added to use as alternatives to the
extractPrediction and extractProbs
functions.J48) and rules-based models (M5 prime)
from RWeka.logitBoost from the caTools
package. This package doesn’t have a namespace and RWeka
has a function with the same name. It was suggested to use the “::”
prefix to differentiate them (but we’ll see how this works).These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.