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

Add as parameter the weights of the positions in the fit methods for the classes of module ot.da #476

Open
framunoz opened this issue May 7, 2023 · 0 comments

Comments

@framunoz
Copy link
Contributor

framunoz commented May 7, 2023

🚀 Feature

Add as parameter the weights of the positions in the fit methods for the classes of module ot.da.

Motivation

In a work I am doing, I need (or needed) a way to obtain the barycentric projection of the measures I had. The classes found in the ot.da module have the transform method, which allows me to do the barycentric projection I was looking for. However, there was the problem that I could not specify what the weights of the positions were going to be.

Pitch

I would like to add a way to specify the position weights to the fit methods of the classes in the ot.da module, because in this module there are classes with several ways to compute the optimal transport that follow the same sklearn interface.

Alternatives

My solution is to add optional mu_s and mu_t parameters to the fit method (and variations of this method) in the BaseTransport class, since it is in this class that the self.mu_s and self.mu_t fields are defined, using the self.distribution_estimation function. Thus, if the weights are not specified, this function would be used instead.

Once this change is made, it would be enough to change the fit methods of the rest of the classes to incorporate this change.

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

No branches or pull requests

1 participant