scikit-learn / scikit-learn/scikit-learn

Feature Request: Partial Least Squares Discriminant Analysis macro

Open
#8,934 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

module:cross_decomposition
Dominant language
Python
Stars
67.3k
Forks
27.4k
Avg merge
1d 15h
Merged PRs (30d)
58

Description

Sklearn implements Partial Least Squares Regression (PLSR) but a very common use for this algorithm is a slight variation called Partial Least Squares Discriminant Analysis (PLS-DA), which is when y is categorical instead of continuous. You can pretty easily write PLS-DA using the PLSR from sklearn, as documented in the first answer to this question but it seems silly that everyone who would want to do PLS-DA has to implement this. Other libraries in R, Matlab, etc... provide an interface to PLS-DA directly, and I think sklearn should too. As I imagine it, this would be a very simple method which just does some LabelEncoding and then calls PLSR, but it would save a lot of folks like myself a lot of time.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with sklearn.cross_decomposition.PLSRegression and the linked Stack Overflow implementation to understand the proposed PLS-DA interface. Clarify how categorical y should be encoded and what tests and documentation are required; the work is done when scikit-learn provides a defined PLS-DA API with verified categorical-target behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, scikit-learn
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.