LSPH - Learned SPatial HashMap

Github Workflow crates.io version dos.io

The original paper of LSPH can be found [here].

The LSPH uses a learned model such as a linear regression model as the hash function to predict the index in a hashmap. As a result, the learned model is more fitted to the data that stored in the hashmap, and reduces the chance of hashing collisions. Moreover, if the learned model is monotonic function(e.g. linear regression), the hash indexes are increasing as the input data increases. This property can be used to create a sorted order of buckets in a hashmap, which allow us to do range searchs in a hashmap.

The LSPH supports:

Example: ``` use lsph::{LearnedHashMap, LinearModel, Point}; let mut data: Vec> = vec![ Point::new(1, 1., 1.), Point::new(2, 3., 1.), Point::new(3, 2., 1.), Point::new(4, 3., 2.), Point::new(5, 5., 1.), ]; let mut map = LearnedHashMap::, f64>::new(); map.batch_insert(&mut data).unwrap();

```

License

Licensed under either of

at your option.