Description Usage Arguments Details Value Note Author(s) See Also
mzpls()
was used to perform the partial least squares discriminant
analysis of the LCMS data (./data/mzdata.rda
)
1 2 3 |
parallel |
Logical indicating if parallel processing should be used. |
save.model |
Logical indicating if the model should be saved. |
view.plot |
Logical indicating if a plot of accuracy vs prcomp should be printed to the plot viewer. |
save.plot |
Logical indicating if plot should be saved to a |
plot.name |
Name of plot if |
model.name |
Name of model if |
seed |
An integer for setting the RNG state. |
pred.results |
Logical indicating if the results of predicting the test data should be printed to the console. |
... |
Other arguments passed on to individual methods. |
mzpls()
loads mzdata
and performs a PLS-DA of the data using
mzdata$class
as outcomes. The process is outlined as follows:
The data is split into training and test sets using an 80:20 stratified
split according to class and day mzdata$class_day
.
A list of random seeds is produced for each iteration of the CV process. For the 10-fold, repeated (3 times) CV used here, we require 10 * 3 seeds for each of the 50 principal components assesed.
Define the CV parameters. 10 folds, 3 repeats, default summary. We also
define the method for selecting the best tune. In this case, the best tune is
the simplest model within one standard error of the empirically
optimal model. This rule, as described by Breiman et al. (1984), may avoid
overfitting the model. Note that k-fold CV as performed using
trainControl(method = "repeatedcv")
stratifies sampling according to
class.
The data is centred by subtracting the mean of the predictor's data from the predictor values
The data is scaled by dividing the predictor's by the standard deviation.
The model is run.
returns a list with class train
.
Although this function is exported, mzpls()
was not intended to
be used outside of this package.
Benjamin R. Gordon
train
ggplot
The caret Package by Max Kuhn (2017)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.