grf-labs / grf

Generalized Random Forests
https://grf-labs.github.io/grf/
GNU General Public License v3.0
938 stars 250 forks source link

Enhance input validation for sample weights #1352

Closed erikcs closed 10 months ago

erikcs commented 10 months ago

Accidentally passing sample weights with missing entries or for example 1 / 0 (as could happen if estimating inverse weights with kaplan-meier, which may yield estimates exactly = 0) went through previously. Adding a more stringent input check to prevent this - as this could be a rare occurrence when passing estimated weights to grf.