Optimization of k nearest neighbor density estimates | Synapse