https://xed.ro/posts/vectorizing-machine-learning-models/