scikit-learn / scikit-learn/scikit-learn
Feature Request: Partial Least Squares Discriminant Analysis macro
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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