View source: R/proximate_read_cal.R
| proximate_read_cal | R Documentation |
Reads the metadata and model parameters from one or more .cal files
generated by BUCHI ProxiMate sensors. The function extracts the preprocessing
recipe, regression method, PLS weights, loadings, scores, intercepts, and
bias terms required to project new spectra into the score space and produce
predictions. Spectral regression coefficients are not retrieved directly;
predictions are computed in the score space via predict.read_cal.
proximate_read_cal(file, ignore_version = FALSE)
## S3 method for class 'read_cal'
predict(object, newdata, get_comp = c("optimal", "all"),
get_scores = FALSE, bias_index = 1, ...)
file |
a character vector of |
ignore_version |
a logical. If |
object |
an object of class |
newdata |
a matrix of new spectral data to predict from. Column names must be coercible to the wavelengths used in the model. |
get_comp |
a character string. Either |
get_scores |
a logical indicating whether PLS scores should be returned
alongside predictions. Default is |
bias_index |
the index of the bias to be applied in the list of biases. These are generated in NIRWise PLUS based on the number of files containing the calibration data. Default = 1. |
... |
not currently used. |
For proximate_read_cal(), a list of class "read_cal" with the following
elements:
summary: a data.frame describing each model:
Property: name of the response variable.
Preprocessing: sequence of preprocessing steps applied (without parameters).
Method: regression method used.
Factors: number of PLS components used.
Cross-validation: number of cross-validation segments.
A value of 0 indicates no cross-validation was used.
Auto-skip: logical indicating whether automatic outlier
removal (auto-delete) was applied during calibration.
meta_param: a list with one element per model containing
the preprocessing recipe (precipe), the indices of automatically
removed observations (auto_skip), and a logical indicating whether
sample aggregation was applied (aggregate).
file_info: a list with one element per model containing
the file paths of the spectral data used for calibration (files)
and the indices of manually skipped observations per file
(skipped_indices).
models: a list with one element per model containing all
parameters required for prediction: wavelengths, preprocessing recipe,
number of factors, mean-centering vector, scores, score scale factors,
PLS weights, loadings, biases, intercept, and target values.
For predict.read_cal(), a list with the following elements:
predictions: predicted values for each model in
object.
distances: scaled score distances for each sample and
model, which can be used to assess how well a new sample is represented
by the model.
scores: only returned when get_scores = TRUE. The
projection of new samples into the PLS score space.
Leonardo Ramirez-Lopez and Claudio Orellano
proximate_recalibrate_nax,
proximate_read_nax
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.