anchor.diff:  
   .Printing out where our cluster centers are located
   [source,scala]
  ----
  +----
   println("Cluster centers:")
   kmeansModel.clusterCenters.foreach(println)
  ----
  +----
   
   We can also obtain a metric on our clustering by computing its "cost" which is
   actually the sum of squared distances affected to a cluster to the closest
  
positive.code: 
  .Pivoting our table by the _type_ column
  [source,scala]
  ---
  val pivotedEvents = groupedEvents
    .groupBy("username")               // <1>
    .pivot("type", distinctEventTypes) // <2>
    .sum("count")                      // <3>
    .na.fill(0L)                       // <4>
  ---
  <1> We have to group our data by the _username_ column in order to have one row
  per user.
  <2> We pivot our table by the _type_ column and we supply the names of the
  
negative.code: example, between data points: the closest data points according to the chosen
  distance are grouped together.
  
  This is a limitation to keep in mind, since we'll be calculating distances
  between data points, the K-Means algorithm can only handle numeric features. We
  will effectively represent our features as a vector and will be calculating
  distances between vectors.
  
  === Flow of the algorithm
  
  Next up, we are going to describe a typical starting cycle for the K-means
  