Description Usage Arguments Value Author(s) Examples
This function accepts a PLS model of class PLScalibration
and new
data as a spectra.matrix
. It uses the pls::predict.mvr method for
predicting new data and also provides a mahalanobis distance (to the
multivariate center of the calibration dataset) for each new sample.
In order to do conduct the prediction, the new data are subsetted with
subsetSpectra()
and then preprocessed with preprocess()
,
according to the optimal transformation information stored in the PLS
calibration object.
1 | predictPLS(object, newdata, ...)
|
object |
An object of class |
newdata |
New data (scans) in the same units and resolution as the
spectra used to fit the PLS model. These spectra should be raw (without
preprocessing) if the spectra used to fit the model were not manually
manipulated before the use of |
... |
Additional args. |
Returns named a vector of predicted values with the following
attributes:
"mahalanobis" - The mahalanobis distance of each new spectrum
from the calibration mean.
"mahalanobis_threshold" - The maximum
mahalanobis distance in the calibration dataset.
"outlier" - Logical.
TRUE is "mahalanobis" is greater than "mahalanobis_threshold."
Daniel M Griffith
1 2 3 4 5 6 7 8 9 10 | ## Not run:
data(shootout)
data(N_cal_shootout)
shootout_scans <- convertSpectra(x = shootout_scans, method = "WL_to_WN")
N_predicted <- predict(object = N_cal_shootout, newdata = shootout_scans)
hist(N_predicted)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.