Add as parameter the weights of the positions in the fit
methods for the classes of module ot.da
#476
Labels
fit
methods for the classes of module ot.da
#476
🚀 Feature
Add as parameter the weights of the positions in the
fit
methods for the classes of moduleot.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 thetransform
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 theot.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
andmu_t
parameters to thefit
method (and variations of this method) in theBaseTransport
class, since it is in this class that theself.mu_s
andself.mu_t
fields are defined, using theself.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.The text was updated successfully, but these errors were encountered: