R/predict_spectra.R
predict_spectra.Rd
Loads an existing model and cross-validation performance
statistics (created with save_model
) and makes predictions
based on new spectra.
predict_spectra(
input.data,
model.stats.location,
model.location,
model.method = "pls",
wavelengths = deprecated()
)
data.frame
object of spectral data for input into a
spectral prediction model. First column contains unique identifiers
followed by spectral columns. Include no other columns to right of spectra!
Column names of spectra must start with "X".
String containing file path (including file name)
to save location of "(model.name)_stats.csv" as output from the
save_model
function.
String containing file path (including file name) to
location where the trained model ("(model.name).Rds") was saved as output
by the save_model
function.
Model type to use for training. Valid options include:
"pls": Partial least squares regression (Default)
"rf": Random forest
"svmLinear": Support vector machine with linear kernel
"svmRadial": Support vector machine with radial kernel
DEPRECATED wavelengths
is no
longer supported; this information is now inferred from input.data
column names
data.frame
object of predictions for each sample (row). First
column is unique identifier supplied by input.data
and second is
predicted values