Skip to content

feat: initial commit with KernelPLS implementation and tests#276

Open
inarteroger wants to merge 3 commits into
mainfrom
273-feature-implementation-of-kernel-pls
Open

feat: initial commit with KernelPLS implementation and tests#276
inarteroger wants to merge 3 commits into
mainfrom
273-feature-implementation-of-kernel-pls

Conversation

@inarteroger
Copy link
Copy Markdown
Collaborator

Why is this change needed?

Adds a KernelPLS regressor to the chemotools.models module.
KernelPLS extends classical PLS to nonlinear relationships by applying
kernel methods and operating in reproducing kernel Hilbert space (RKHS).

This provides a flexible alternative to standard PLSRegression,
particularly useful for nonlinear spectral data.


Type of change

  • New feature

Description

Implementation of KernelPLS following the method described in:

[1] Rosipal, R. & Trejo, L. J. (2001).
Kernel Partial Least Squares Regression in Reproducing Kernel
Hilbert Space. Journal of Machine Learning Research, 2, 97–123.
http://www.jmlr.org/papers/volume2/rosipal01a/rosipal01a.pdf

Implementation of Kernel Partial Least Squares (KernelPLS),
supporting multiple kernel functions (linear, rbf, polynomial, sigmoid)
and compatible with the scikit-learn estimator API.

The model computes pairwise kernels, centers them using KernelCenterer,
and applies PLSRegression on the transformed feature space.


What was added

  • KernelPLS estimator in chemotools/models/_kernel_pls.py
  • Full sklearn API compliance:
    • fit, predict, transform, fit_transform, score
  • Support for multiple kernels:
    • linear, rbf, poly, sigmoid

Tests added

  • sklearn estimator compliance (check_estimator)
  • fit/predict/transform correctness
  • consistency with sklearn reference implementation:
    (KernelCenterer + PLSRegression)
  • input validation
  • pipeline and GridSearchCV compatibility

@inarteroger inarteroger requested a review from paucablop May 25, 2026 13:26
@inarteroger inarteroger self-assigned this May 25, 2026
@inarteroger inarteroger added the enhancement New feature or request label May 25, 2026
@inarteroger inarteroger linked an issue May 25, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Implementation of Kernel PLS

1 participant