title: Chain MinHash and LSH (BucketedRandomProjectionLSH) in Spark for approx distance and false positive/negatives
body: <p>I have a very very large document base, and turn each document into a Set of its ngrams (character based ngrams) and then Use a CountVecotrizer. I want to speed up both the actual distance calculation (by using MinHashes to approixmate Jaccard Distance, but also use a LSH technique for Bucketing. This will give me false negatives and false positives in both the bucketing and the minhash steps of the algorithm, but thats ok. It's the only way I can crunch my data.</p>
  <p>My problem is, that sparks MinHash returns an Array(DenseVector, true) where each DenseVector is 1-dim.</p>
  <p>LSH then expects a DenseVector. So what I want to do is turn an Array of 1-dim DenseVectors into a n-dim DenseVector. How can I do that with Spark?</p>
  <p>I have uncussefully tried</p>
  <ul>
  <li>vectorassembler</li>
  <li>udf</li>
  <li>pandas_udf</li>
  </ul>