% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/spectra-predict.R
\name{predict_ossl_plsr_local}
\alias{predict_ossl_plsr_local}
\title{Local PLSR prediction against the OSSL library}
\usage{
predict_ossl_plsr_local(
  X,
  properties,
  region = "global",
  k = 100L,
  ossl_library = NULL,
  ...
)
}
\arguments{
\item{X}{A pre-processed numeric matrix (rows = horizons,
columns = wavelengths).}

\item{properties}{Character vector of OSSL-supported property names.}

\item{region}{One of \code{"global"}, \code{"south_america"},
\code{"north_america"}, \code{"europe"}, \code{"africa"}.}

\item{k}{Integer number of neighbours.}

\item{ossl_library}{Optional list with the OSSL training spectra
(\code{Xr}) and reference values (\code{Yr}, a data.frame
keyed by \code{properties}). When \code{NULL}, the synthetic
path is used.}

\item{...}{Additional arguments forwarded to \code{resemble::mbl}.}
}
\value{
A data.table with the same schema as
        \code{\link{predict_ossl_mbl}}.
}
\description{
Selects the \code{k} nearest neighbours to each test spectrum in
the OSSL training set and fits a local PLS regression. Like
\code{\link{predict_ossl_mbl}}, this function dispatches to
\code{resemble::mbl} (with a \code{local_algorithm = "pls"} setting)
when the dependency is available; otherwise it falls back to the
synthetic predictor.
}
