Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weighted PLS #38

Open
nic-Oban opened this issue Nov 28, 2024 · 3 comments
Open

Weighted PLS #38

nic-Oban opened this issue Nov 28, 2024 · 3 comments

Comments

@nic-Oban
Copy link

Hello,
thanks for this fine tuned pls that is very fast!
I searched for but can't find anything on weighted pls. Is there any optimized option to apply a diagonal matrix of sample weights in your algorithm? (as in Schaal et al. 2002)
In WPLSR, a priori weights, different from the usual 1/n (standard PLSR), are given to the n training observations. These weights are used for calculating (i) the scores and loadings of the WPLS and (ii) the regression model that fits (by weighted least squares) the Y-response(s) to the WPLS scores.
Thanks a lot and have a good day.
Nicolas

@Sm00thix
Copy link
Owner

Sm00thix commented Dec 1, 2024

Hi Nicolas,

I'm glad you like the software :-)

I am unsure whether you are asking for weights for the regular PLS implementations in ikpls.numpy_ikpls and ikpls.jax_ikpls_alg_1 and ikpls.jax_ikpls_alg_2 or the fast cross-validation implementation in ikpls.fast_cross_validation.numpy_ikpls.

For the regular PLS implementations, adding the option for class weights is definitely doable. I will implement this in the future. However, as I am currently busy with other aspects of my Ph. D. programme, it might be a while. In the meantime, should another developer make the required modifications to the code. I am happy to merge them given they follow the Contribution Guidelines.

For the fast cross-validation, it remains an open problem whether class weights can be supported without compromising the superior computational complexity of the fast algorithm. However, I suspect that it is actually possible to solve this problem. I will definitely try and tackle it in the not-so-distant future.

Best,
Ole

@nic-Oban
Copy link
Author

nic-Oban commented Dec 2, 2024

Hello Ole,
thanks for your answer.
As a first step, I'd like to weight the numpy_ikpls but the CV-one would be a great one too!
I'll have a look at the nupy_ikpls if I find some time. Thanks a lot again and have good day.
Nicolas

@Sm00thix
Copy link
Owner

Sm00thix commented Dec 3, 2024

Hi Nicolas,

Sounds good :-)
I will keep this issue open until someone implements weights. I will do it myself when I have time if no one beats me to it.

Have a nice day!

Best,
Ole

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants