`sample_weight` in DomainAdaptationLearner `_fit_weighted_pipeline()` method should be kwarg
Open
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 4.8k
- Forks
- 827
- PR merge metrics
- No merged PRs in 30d
Description
Arbitrary sklearn ML models do not have a positional argument for sample_weight in the fit() method, so the following change needs to be made:
if not isinstance(model_instance, Pipeline):
model_instance.fit(X, y, sample_weight)
Should be changed to:
if not isinstance(model_instance, Pipeline):
model_instance.fit(X, y, sample_weight=sample_weight)
Contributor guide
No contributing guide indexed for this repository
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
Search the repository for DomainAdaptationLearner and its _fit_weighted_pipeline() method, then inspect the non-Pipeline model fit call. Confirm that sample_weight is passed as a keyword argument and verify the relevant learner behavior with the existing test suite; done means arbitrary scikit-learn models accept the weighted fit without a positional-argument error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, scikit-learn
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100