skada icon indicating copy to clipboard operation
skada copied to clipboard

[API] fit, predict and other functions should accept X,y,smaple_weight as first parameters by default

Open rflamary opened this issue 6 months ago • 2 comments

In order to stay compatible with skleranAPI we want all estimatoer (and Adapters) to have functions that accept unnamed sample_weightby defalult.

For the moment we have for Adapter and DAEstimator:

    @abstractmethod
    def fit(self, X, y=None, sample_domain=None, *, sample_weight=None):
        """Fit adaptation parameters"""

I suggest we change it to

    @abstractmethod
    def fit(self, X, y=None, sample_weight=None sample_domain=None, *):
        """Fit adaptation parameters"""

that will allow to do things like

   model.fit( X, y, sample_weight, sample_domain):

the named sample_domain will still be necessary for pipelines

rflamary avatar Feb 14 '24 15:02 rflamary