This random hyper plane algorithm is actually a pretty elegant algorithm. It has the following amazing property: as your dimension increases, the quality of the random hyper planes actually gets better!
And it is around 10 lines of code in SQL: https://presentations.clickhouse.com/meetup74/ai/#35