Choosing how to choose with self-normalising weights

Nice! I think this is the best solution yet.

Pros:

  • addresses the primary issue raised by the PR author (a way to normalize weights)
    • relatedly: choose, perhaps the more commonly used/remembered, defaults to “expected” behavior—normalizing by default
  • unifies the interface between choose, wchoose, and TWChoose (and the t/wchoose defaults match)
  • both methods allow for optimization by the user
  • backwards compatible - nothing breaks, including old habits :slight_smile: (wchoose)
  • fits the quick iterative workflow outlined by @semiquaver (common use)
  • leaves room for future optimization without disrupting the interface (as alluded to by @semiquaver and @smoge’s ideating)

Cons

  • the curious user wonders why the redundant functionality and mismatched defaults (so docs explain the legacy behavior, logic of pre-normalization, and accompanying examples show a simple illustrative benchmark)

Missing anything?

A separate initiative/PR could introduce this new interface where it makes sense. Weighted distributions is very “at home” in collections, so it seems unlikely there would be objections to the new feature introduced here and not elsewhere (yet).

Yes!

1 Like