
Package index
OSSL Data
Download the Open Soil Spectral Library from its official storage bucket into a user-local cache. autoSpectra never redistributes OSSL data.
-
ossl_cache_dir() - Default local cache directory for OSSL data
-
ossl_download() - Download all three OSSL components (VisNIR, MIR, soillab)
-
ossl_download_file() - Download one OSSL component file to the cache directory
-
ossl_join() - Join OSSL spectra with soil lab data for model training
-
ossl_l1_labels - Fancy display labels for OSSL L1 properties
-
ossl_l1_log_transform - Properties that Safanelli log1p-transforms before fitting
-
ossl_l1_properties - All OSSL Level-1 harmonized soil property variable names (34 targets)
-
ossl_load_raw() - Load a cached OSSL CSV (gzipped) as a data.table
-
ossl_mir_instruments - MIR instruments contributing to OSSL v1.2
-
ossl_mir_matrix() - Extract OSSL MIR spectra as a matrix aligned to the OSSL standard grid
-
ossl_prepare() - Convenience: load and join all OSSL data for a given sensor type
-
ossl_soillab() - Extract OSSL Level-1 soil lab data for a set of properties
-
ossl_visnir_instruments - VisNIR instruments contributing to OSSL v1.2
-
ossl_visnir_matrix() - Extract OSSL VisNIR spectra as a matrix aligned to the OSSL standard grid
-
download_ossl_models() - Download pre-trained OSSL soilVAE models from Zenodo
-
models_available() - Check whether pre-trained models are available locally
-
audit_release_archive() - Audit a built release archive for redistributed OSSL training data
-
predict_soil() - Predict soil properties from a spectral data frame
-
predict_applicability() - Compute applicability-domain scores for new spectra
-
format_predictions() - Round predictions and rename columns to display labels
-
get_family() - Lookup a model family from the registry
-
family_matches() - Test whether a family matches a sensor type
-
property_label() - Get a display label for a soil property key
-
preprocess_visnir() - Canonical Safanelli preprocessing for VisNIR (reflectance input)
-
preprocess_mir() - Canonical Safanelli preprocessing for MIR (absorbance input)
-
reflectance_to_absorbance() - Convert reflectance to absorbance
-
apply_pipeline() - Apply a spectral preprocessing pipeline
-
apply_sg_matrix() - Apply Savitzky-Golay filter row-wise to a spectral matrix
-
apply_snv() - Apply Standard Normal Variate (SNV) row-wise
-
apply_snv_masked() - Apply SNV using only the masked (covered) bands of each row
-
parse_sg() - Parse SG parameter string of the form "SG(m,p)", "SG(m,p,d)", etc.
-
sg_safe_params() - Compute safe SG parameters given available number of columns
-
resample_to_grid() - Resample a spectral matrix to a target wavelength grid via linear interpolation
-
get_wavelengths() - Extract wavelength/wavenumber positions from a data frame's column names
-
mask_from_coverage() - Build a coverage mask from a resampled spectral matrix
-
has_spectral_coverage() - Which rows carry any spectral signal at all
Target Transforms
log1p transform for skewed properties and its bounded inverse, which keeps predictions inside the calibration range
-
apply_target_transform() - Forward log1p transform for properties whose policy asks for it
-
invert_target_transform() - Invert the target transform without letting it explode
-
target_bounds() - Training-scale bounds used to keep a back-transform from extrapolating
-
metrics_original_scale() - Score predictions in original units, with the bounded back-transform
-
build_maskedVAE() - Build a masked soilVAE for sensor-agnostic prediction
-
train_maskedVAE() - Train a masked soilVAE for one soil property
-
build_soilVAE() - Build a standard soilVAE
-
train_soilVAE() - Train a (standard) soilVAE model for one soil property
-
load_soilVAE() - Load a saved soilVAE model and its scaler
-
spectral_dropout() - Random spectral-dropout augmentation for masked-VAE training
-
train_ossl_models() - Train soilVAE models for all properties of one model family using OSSL data
-
train_cubist_pca() - Train one Cubist + PCA(120) model for a single soil property
-
load_cubist_pca() - Load a saved Cubist + PCA bundle for a property
-
predict_cubist_pca() - Predict with a Cubist + PCA bundle
-
q_statistic() - Compute the Q-statistic for each row of a PCA residual matrix
-
q_statistic_ucl() - Upper Confidence Limit for the Q-statistic (Jackson-Mudholkar 1979)
-
predict_q_statistic() - Compute Q-statistic and in-domain flag for new spectra against a fitted PCA
-
mahalanobis_d2() - Squared Mahalanobis distance against a multivariate Gaussian (mu, Sigma)
-
mahalanobis_threshold() - Chi-squared threshold for the Mahalanobis test in latent space
-
train_normalized_conformal() - Train a normalised-conformal calibration for a Cubist + PCA model
-
predict_with_pi() - Predict with prediction intervals using a normalised-conformal calibration
-
absolute_conformal() - Simple absolute-residual conformal calibration (used by the VAE family)
-
cv_train_property() - Perform 10-fold CV with refitting for one (family, property) combination
-
random_kfold() - Build random 10-fold indices (Safanelli default)
-
stratified_kfold() - Build Leave-One-Dataset-Out (LODO) k-fold indices
-
split_idx() - Split indices into train / calibration / test sets
-
metrics_from_y() - Compute prediction metrics (RMSE, Bias, R², RPIQ, CCC)
-
get_cached_model() - Retrieve a soilVAE model from the in-memory cache
-
preload_ossl_models() - Pre-load all soilVAE models for a family into memory
-
list_cached_models() - List models currently held in the in-memory cache
-
clear_model_cache() - Clear the in-memory model cache
-
plot_spectra() - Plot one or more spectra from a data frame
-
plot_mean_spectrum() - Plot a mean spectrum with +/-1 SD ribbon
-
plot_predictions() - Plot predicted vs observed values for a soil property
-
plot_applicability() - Plot applicability-domain scores
-
model_registry - Official autoSpectra model family registry
-
ossl_l1_properties - All OSSL Level-1 harmonized soil property variable names (34 targets)
-
ossl_l1_labels - Fancy display labels for OSSL L1 properties
-
ossl_visnir_instruments - VisNIR instruments contributing to OSSL v1.2
-
ossl_mir_instruments - MIR instruments contributing to OSSL v1.2
-
run_autoSpectra() - Launch the autoSpectra Shiny application
-
save_scaler() - Save a z-score scaler to RDS and JSON
-
save_metrics_json() - Save per-model metrics JSON (RMSE, R2, RPIQ, conformal quantiles, latent stats)
-
feature_minmax() - Compute per-band min/max feature range from a preprocessed matrix
-
dir_create() - Create a directory if it does not already exist
-
vneed() - Safe shiny::validate wrapper