annoy4s (homepage)

A Scala Implementation of Annoy which searches nearest neighbors given query point. Ann4s also provides DataFrame-based API for Apache Spark.

@mskimm / (0)

val dataset: DataFrame = ??? // your dataset
val alsModel: ALSModel = new ALS()
.fit(dataset)
val annoyModel: AnnoyModel = new Annoy()
.setDimension(alsModel.rank)
.fit(alsModel.itemFactors)
val result: DataFrame = annoyModel
.setK(10) // find 10 neighbors
.transform(alsModel.itemFactors)
result.show()


Tags

  • 1|machine learning
  • 1|kNN

How to

This package doesn't have any releases published in the Spark Packages repo, or with maven coordinates supplied. You may have to build this package from source, or it may simply be a script. To use this Spark Package, please follow the instructions in the README.

Releases

No releases yet.