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

Sample weight support for regression problems #1

Closed
kmedved opened this issue Apr 2, 2021 · 3 comments
Closed

Sample weight support for regression problems #1

kmedved opened this issue Apr 2, 2021 · 3 comments

Comments

@kmedved
Copy link

kmedved commented Apr 2, 2021

Hello - I just saw this library written up on Medium and it looks very interesting. I wanted to ask about the possibility of adding Sample Weight support for it? Xgboost already has support for it via the weight parameter in the .fit() call, so I'm not sure what would be needed other than updating the API to allow a user to pass sample weights.

Thanks!

@rsesha
Copy link

rsesha commented Apr 26, 2021

Hello kmedved:
It should be possible to send the sample_weight parameter. Let me look into it and update this library if possible.
Ram

@kmedved
Copy link
Author

kmedved commented Apr 27, 2021

Great to hear. Thanks!

@AutoViML
Copy link
Owner

AutoViML commented Jan 31, 2022

Hi @kmedved 👍
Sorry it took so long to add sample weight functionality to featurewiz . It now adds sample weights automatically for classification problems. You can see the code here:

if modeltype == 'Multi_Classification':
    wt_array = get_sample_weight_array(y_train)
    dtrain = xgb.DMatrix(x_train, label=y_train, weight=wt_array)

It adds sample weights for multi-class problems and adds scale_pos_weight for binary class problems as you can see here:

scale_pos_weight = get_scale_pos_weight(y_train)

I hope this is good for you. if you want to send in a sample weight separately I need to change the input arguments, hence I thought I will do it automatically. Take a look at the latest version:

pip install featurewiz --upgrade

Thanks
Auto_ViML

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

No branches or pull requests

3 participants