Skip to content

Add ability to pass sample weights for training #154

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

Closed
pplonski opened this issue Aug 28, 2020 · 9 comments
Closed

Add ability to pass sample weights for training #154

pplonski opened this issue Aug 28, 2020 · 9 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@pplonski
Copy link
Contributor

There should be an option to pass weights for training. Weights should be used in metrics as well.

@pplonski pplonski added enhancement New feature or request help wanted Extra attention is needed labels Aug 28, 2020
@diogosilva30
Copy link
Contributor

Do you mean class_weights? So it pays more "attention" to a certain class in a classification task?

@pplonski
Copy link
Contributor Author

I mean sample weights. For class weights, I've created separate issue #155

@pplonski
Copy link
Contributor Author

pplonski commented Dec 3, 2020

@kmedved this can be added to the next major release. Would you like to help? Even testing or providing use cases would be nice.

@pplonski pplonski added this to the version 0.8.0 milestone Dec 3, 2020
@pplonski pplonski self-assigned this Dec 3, 2020
@kmedved
Copy link

kmedved commented Dec 3, 2020

I would be happy to help with testing or use cases; actual code contribution is over my head unfortunately.

@pplonski pplonski changed the title Add ability to pass weights for training Add ability to pass sample weights for training Dec 9, 2020
pplonski added a commit that referenced this issue Dec 14, 2020
pplonski added a commit that referenced this issue Dec 14, 2020
@pplonski
Copy link
Contributor Author

User can pass sample_weight in the fit():

automl = AutoML()
automl.fit(X, y, sample_weight)

The default for sample_weight is None. All metrics (eval_metric and additional metrics) use sample_weight if available.

The algorithms that don't support sample_weight:

  • MLP Classfier and Regressor (docs)
  • kNN Classifier and Regressor (docs)

@pplonski
Copy link
Contributor Author

@kmedved I just finished sample_weight functionality. It is available in the dev branch. If you have use cases for testing, I'll be happy to hear feedback from you!

@kmedved
Copy link

kmedved commented Dec 16, 2020

Thanks @pplonski - I will do some testing. Thanks!

@alitirmizi23
Copy link

@pplonski does adding sample_weight in .fit() cause training to pay more attention to heavily weighted samples or is it just for calculating metrics?

@pplonski
Copy link
Contributor Author

@alitirmizi23 you are right, the higher the weight the more attention during the training.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants