Skip to contents

Core model development workflow

These functions prepare spectra for model development and allow for the streamlined testing of model performance.

plot_spectra()
Plot spectral data, highlighting outliers as identified using Mahalanobis distance
filter_spectra()
Filter spectral data frame based on Mahalanobis distance
aggregate_spectra()
Aggregate data based on grouping variables and a user-provided function
test_spectra()
Test the performance of spectral models

Internal use

While these functions can be used on their own, they were developed to be called within test_spectra().

pretreat_spectra()
Pretreat spectral data according to user-designated method
format_cv()
Format multiple trials with or without overlapping genotypes into training and test sets according to user-provided cross validation scheme
train_spectra()
Train a model based predict reference values with spectral data

Model development and testing for routine use

save_model()
Save spectral prediction model and model performance statistics
predict_spectra()
Use provided model object to predict trait values with input dataset

Example Dataset

ikeogu.2017
Example vis-NIRS and reference dataset