facebookresearch / balance

The balance python package offers a simple workflow and methods for dealing with biased data samples when looking to infer from them to some target population of interest.
https://import-balance.org
GNU General Public License v2.0
686 stars 42 forks source link

[FEATURE] Raise error (or warning?!) when providing weights with 'None' #78

Open talgalili opened 7 months ago

talgalili commented 7 months ago

Not sure yet if it's better to raise an error, or a warning (and impute it with 0s). But let's go with error. But at least it's worth giving a printout of userid with the None weights (or at least "head" of it, maybe with some of their features also)

A good place to do this is by adding the check here: https://github.com/facebookresearch/balance/blob/main/balance/sample_class.py#L268

And add tests that verify it works here: https://github.com/facebookresearch/balance/blob/main/tests/test_sample.py