How it works...

  1. CoordinateMatrix is a specialized matrix in which each entry is a coordinate system or a tuple of three numbers (long, long, long corresponding to x, y, z coordinates). A related data structure is MatrixEntry, in which coordinates will be stored and then placed at a location in the CoordinateMatrix. The following code snippet demonstrates the use of MaxEntry, which seems to be a source of confusion in itself.

 

  1. The following figure shows a pictorial view of the CoordinateMatrix, which should help clarify the subject:

The code snippet which holds three coordinates is:

MatrixEntry(1, 6, 300), MatrixEntry(3, 1, 5), MatrixEntry(1, ...

Get Apache Spark 2.x Machine Learning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.