Comment

Comment by wrsh07

I'm somewhat curious about the initial problem:

> Consider the following real problem, one of the steps in scikit-learn’s gradient histogram boosting algorithm:

> You have a large array of floating point numbers.

> You want to assign them to the integer range 0-254, spread out evenly.

Naively I would consider sorting the initial array and then using something like `batched` from itertools to chunk them into the 255 buckets - binary search will give you a bunch of random accesses, and sorting can be cache-oblivious (eg efficient for arbitrary data sizes)

But I'm somewhat concerned I don't fully understand the underlying problem being solved with this step, so I might be misunderstanding the intended result

parent wrsh07 3 months ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton