Package: lwpls 0.3.0

lwpls: Locally-Weighted Partial Least Squares for 'tidymodels'

Locally-weighted partial least squares (LW-PLS) is a just-in-time learning method that builds a dedicated weighted partial least squares model around every new sample, where training samples are weighted by their similarity to that sample (Kim et al. (2011) <doi:10.1016/j.ijpharm.2011.10.007>). Regression (single or multiple outcomes) and classification (locally weighted partial least squares-discriminant analysis; Bevilacqua and Marini (2014) <doi:10.1016/j.aca.2014.05.057>) are supported. The local models can be robust to outliers, by partial robust M-regression (Serneels et al. (2005) <doi:10.1016/j.chemolab.2005.04.007>), and sparse (Hoffmann et al. (2015) <doi:10.1016/j.chemolab.2015.09.019>). The prediction kernel is written in C++ with 'RcppArmadillo', and the model is integrated with the 'parsnip', 'dials', 'tune' and 'yardstick' packages so it can be used within the 'tidymodels' framework. Diagnostics of the local models (prediction reliability, local regression vectors, robust weights and selected predictors) come with 'ggplot2' plots designed for spectroscopic data.

Authors:Christian L. Goueguel [aut, cre]

lwpls_0.3.0.tar.gz
lwpls_0.3.0.zip(r-4.7-x86_64)lwpls_0.3.0.zip(r-4.7-arm64)lwpls_0.3.0.zip(r-4.6-x86_64)lwpls_0.3.0.zip(r-4.6-arm64)lwpls_0.3.0.zip(r-4.5-x86_64)
lwpls_0.3.0.tgz(r-4.6-x86_64)lwpls_0.3.0.tgz(r-4.6-arm64)lwpls_0.3.0.tgz(r-4.5-x86_64)lwpls_0.3.0.tgz(r-4.5-arm64)
lwpls_0.3.0.tar.gz(r-4.7-arm64)lwpls_0.3.0.tar.gz(r-4.7-x86_64)lwpls_0.3.0.tar.gz(r-4.6-arm64)lwpls_0.3.0.tar.gz(r-4.6-x86_64)
lwpls_0.3.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
lwpls/json (API)

# Install 'lwpls' in R:
install.packages('lwpls', repos = c('https://christiangoueguel.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/christiangoueguel/lwpls/issues

Pkgdown/docs site:https://christiangoueguel.com

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

chemometricsjust-in-time-learninglocally-weighted-plslwplsdalwplsrmachine-learningnir-spectroscopyparsnippartial-least-squaresrcppsoft-sensortidymodelsopenblascpp

3.30 score 13 exports 41 dependencies

Last updated from:92635020ad. Checks:15 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK153
linux-devel-x86_64OK189
source / vignettesOK262
linux-release-arm64OK142
linux-release-x86_64OK196
macos-release-arm64OK152
macos-release-x86_64OK253
macos-oldrel-arm64OK147
macos-oldrel-x86_64OK221
windows-devel-arm64OK275
windows-devel-x86_64OK185
windows-release-arm64OK329
windows-release-x86_64OK178
windows-oldrel-x86_64OK109
wasm-releaseOK126

Exports:localizationlwplslwpls_fitlwpls_localplot_coefficientsplot_reliabilityplot_robust_weightsplot_selectionsimilaritysparsitytrimmed_rmsetrimmed_rmse_vecvalues_similarity

Dependencies:clicodetoolscpp11dialsDiceDesigndplyrfarvergenericsggplot2globalsgluegtablehardhatisobandlabelinglifecyclemagrittrparsnippillarpkgconfigprettyunitspurrrR6RColorBrewerRcppRcppArmadillorlangS7scalessfdsparsevctrsstringistringrtibbletidyrtidyselectutf8vctrsviridisLitewithryardstick

Choosing a similarity index
One weight function, two distances | Euclidean distance | Covariance-based distance | The three neighborhoods side by side | When the covariance-based index helps | When the covariance-based index fails | Choosing in practice | References

Last update: 2026-10-07
Started: 2026-10-07

Introduction to lwpls
The algorithm | Regression: fat-free water content of meat from NIR spectra | Comparison with global PLS | Similarity indexes | Classification | Using the engine directly | Robust and sparse local models | Engine arguments | References

Last update: 2026-10-07
Started: 2026-10-06

Diagnostic plots for spectroscopy
Can I trust this prediction? | Theoretical limits and percentile ranks | Which bands drive the predictions? | Which reference values are suspect? | Which wavelengths are selected? | Customizing the plots | References

Last update: 2026-10-06
Started: 2026-10-06

Robust and sparse LW-PLS
Robust LW-PLS | Why | Example: wrong reference values | Sparse LW-PLS | Sparse and robust | References

Last update: 2026-10-06
Started: 2026-10-06

Readme and manuals

Help Manual

Help pageTopics
Localization parameter for LW-PLSlocalization
Locally-weighted partial least squareslwpls
Fit a locally-weighted partial least squares modellwpls_fit lwpls_fit.data.frame lwpls_fit.default lwpls_fit.formula lwpls_fit.matrix lwpls_fit.recipe
Local models of LW-PLS predictionslwpls_local lwpls_local.default lwpls_local.lwpls_fit lwpls_local.model_fit lwpls_local.workflow
Plots of LW-PLS local modelsautoplot.lwpls_local lwpls_plots plot_coefficients plot_reliability plot_robust_weights plot_selection
Predictions for several numbers of componentsmulti_predict._lwpls_fit
Predict from a locally-weighted PLS modelpredict.lwpls_fit
Similarity index for LW-PLSsimilarity values_similarity
Sparsity of the LW-PLS local modelssparsity
Trimmed root mean squared errortrimmed_rmse trimmed_rmse.data.frame trimmed_rmse_vec
Update a locally-weighted PLS specificationupdate.lwpls