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? #31

Closed
kmedved opened this issue Jan 23, 2020 · 2 comments
Closed

Sample_weight? #31

kmedved opened this issue Jan 23, 2020 · 2 comments

Comments

@kmedved
Copy link

kmedved commented Jan 23, 2020

Is there any way to pass a sample weight column into a Dataset object, or is there any plan to add this functionality? It should fit pretty smoothly into the sklearn framework I would expect, but maybe I'm missing something.

Thanks for the wonderful package!

@aerdem4
Copy link
Owner

aerdem4 commented Jan 23, 2020

@kmedved Thanks for your question. You can pass your sample weights to LOFOImportance in fit_params. Example:

fi = LOFOImportance(dataset, scoring=scorer, model=LinearRegression(), cv=cv, 
                    fit_params={"sample_weight": df["sw"].values})

Let me know if it works for you.

@kmedved
Copy link
Author

kmedved commented Jan 23, 2020

Excellent - that worked great. Thanks for the quick reply. That functionality really helps makes this a first-rate feature selection tool.

Eager to watch for future improvements.

@aerdem4 aerdem4 closed this as completed Jan 23, 2020
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

2 participants