Skip to content
  • gord chung's avatar
    7eaaad03
    optimise percentile computation with pure numpy · 7eaaad03
    gord chung authored
    i believe i figured out how percentile is computed. this does
    something very similar to median (for obvious reasons). at highlevel:
    - get the index the percentile would land on and assume it falls
    between indices
    - take the values of the indices it falls between and figure out
    weight of each value.
    - handle the percentiles that fall on an exact index.
    
    this is ~30x better. it's actually a bit slower (3%-5%?) than the
    median computation so it's debatable if we want to remove median code.
    
    drop scipy. also remove numpy.lib.recfunctions as it doesn't seem to
    used anywhere.
    7eaaad03
    optimise percentile computation with pure numpy
    gord chung authored
    i believe i figured out how percentile is computed. this does
    something very similar to median (for obvious reasons). at highlevel:
    - get the index the percentile would land on and assume it falls
    between indices
    - take the values of the indices it falls between and figure out
    weight of each value.
    - handle the percentiles that fall on an exact index.
    
    this is ~30x better. it's actually a bit slower (3%-5%?) than the
    median computation so it's debatable if we want to remove median code.
    
    drop scipy. also remove numpy.lib.recfunctions as it doesn't seem to
    used anywhere.
Loading