implicit final class AnnoyPairSCollection extends AnyVal
- Source
- package.scala
- Alphabetic
- By Inheritance
- AnnoyPairSCollection
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new AnnoyPairSCollection(self: SCollection[(Int, Array[Float])])
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- def asAnnoy(metric: AnnoyMetric, dim: Int, nTrees: Int): SCollection[AnnoyUri]
Write the key-value pairs of this SCollection as an Annoy file to a temporary location, building the trees in the index according to the parameters provided.
Write the key-value pairs of this SCollection as an Annoy file to a temporary location, building the trees in the index according to the parameters provided.
- nTrees
Number of trees to build. More trees means more precision & bigger indices. If nTrees is set to -1, the trees will automatically be built in such a way that they will take at most 2x the memory of the vectors.
- returns
A singleton SCollection containing the AnnoyUri of the saved files
- Annotations
- @experimental()
- def asAnnoy(path: String, metric: AnnoyMetric, dim: Int, nTrees: Int): SCollection[AnnoyUri]
Write the key-value pairs of this SCollection as an Annoy file to a specific location, building the trees in the index according to the parameters provided.
Write the key-value pairs of this SCollection as an Annoy file to a specific location, building the trees in the index according to the parameters provided.
- path
Can be either a local file or a GCS location e.g. gs://<bucket>/<path>
- metric
One of Angular (cosine distance) or Euclidean
- dim
Number of dimensions in vectors
- nTrees
Number of trees to build. More trees means more precision & bigger indices. If nTrees is set to -1, the trees will automatically be built in such a way that they will take at most 2x the memory of the vectors.
- returns
A singleton SCollection containing the AnnoyUri of the saved files
- Annotations
- @experimental()
- def asAnnoySideInput(metric: AnnoyMetric, dim: Int, nTrees: Int): SideInput[AnnoyReader]
Write the key-value pairs of this SCollection as an Annoy file to a temporary location, building the trees in the index according to the parameters provided, then load the trees as a side input.
Write the key-value pairs of this SCollection as an Annoy file to a temporary location, building the trees in the index according to the parameters provided, then load the trees as a side input.
- metric
One of Angular (cosine distance) or Euclidean
- dim
Number of dimensions in vectors
- nTrees
Number of trees to build. More trees means more precision & bigger indices. If nTrees is set to -1, the trees will automatically be built in such a way that they will take at most 2x the memory of the vectors.
- returns
SideInput[AnnoyReader]
- Annotations
- @experimental()
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def toString(): String
- Definition Classes
- Any