ScaDaMaLe Course site and book

Million Song Dataset - Kaggle Challenge

Predict which songs a user will listen to.

SOURCE: This is just a Scala-rification of the Python notebook published in databricks community edition in 2016.

Stage 3: Modeling Songs via k-means

Model

This is the third step into our project. In the first step we parsed raw text files and created a table. Then we explored different aspects of data and learned that things have been changing over time. In this step we attempt to gain deeper understanding of our data by categorizing (a.k.a. clustering) our data. For the sake of training we pick a fairly simple model based on only three parameters. We leave more sophisticated modeling as exercies to the reader

We pick the most commonly used and simplest clustering algorithm (KMeans) for our job. The SparkML KMeans implementation expects input in a vector column. Fortunately, there are already utilities in SparkML that can help us convert existing columns in our table to a vector field. It is called VectorAssembler. Here we import that functionality and use it to create a new DataFrame

// Let's quickly do everything to register the tempView of the table here

// this is a case class for our row objects
case class Song(artist_id: String, artist_latitude: Double, artist_longitude: Double, artist_location: String, artist_name: String, duration: Double, end_of_fade_in: Double, key: Int, key_confidence: Double, loudness: Double, release: String, song_hotness: Double, song_id: String, start_of_fade_out: Double, tempo: Double, time_signature: Double, time_signature_confidence: Double, title: String, year: Double, partial_sequence: Int)

def parseLine(line: String): Song = {
  // this is robust parsing by try-catching type exceptions
  
  def toDouble(value: String, defaultVal: Double): Double = {
    try {
       value.toDouble
    } catch {
      case e: Exception => defaultVal
    }
  }

  def toInt(value: String, defaultVal: Int): Int = {
    try {
       value.toInt
      } catch {
      case e: Exception => defaultVal
    }
  }
  // splitting the sting of each line by the delimiter TAB character '\t'
  val tokens = line.split("\t")
  
  // making song objects
  Song(tokens(0), toDouble(tokens(1), 0.0), toDouble(tokens(2), 0.0), tokens(3), tokens(4), toDouble(tokens(5), 0.0), toDouble(tokens(6), 0.0), toInt(tokens(7), -1), toDouble(tokens(8), 0.0), toDouble(tokens(9), 0.0), tokens(10), toDouble(tokens(11), 0.0), tokens(12), toDouble(tokens(13), 0.0), toDouble(tokens(14), 0.0), toDouble(tokens(15), 0.0), toDouble(tokens(16), 0.0), tokens(17), toDouble(tokens(18), 0.0), toInt(tokens(19), -1))
}

// this is loads all the data - a subset of the 1M songs dataset
val dataRDD = sc.textFile("/datasets/sds/songs/data-001/part-*") 

// .. fill in comment
val df = dataRDD.map(parseLine).toDF

// .. fill in comment
df.createOrReplaceTempView("songsTable")
defined class Song
parseLine: (line: String)Song
dataRDD: org.apache.spark.rdd.RDD[String] = /datasets/sds/songs/data-001/part-* MapPartitionsRDD[380] at textFile at command-2971213210277067:32
df: org.apache.spark.sql.DataFrame = [artist_id: string, artist_latitude: double ... 18 more fields]
import org.apache.spark.ml.feature.VectorAssembler

val trainingData = new VectorAssembler()
                      .setInputCols(Array("duration", "tempo", "loudness"))
                      .setOutputCol("features")
                      .transform(table("songsTable"))
import org.apache.spark.ml.feature.VectorAssembler
trainingData: org.apache.spark.sql.DataFrame = [artist_id: string, artist_latitude: double ... 19 more fields]

All we have done above with the VectorAssembler method is:

  • created a DataFrame called trainingData
  • that transformed our table called songsTable
  • by adding an output column named features using setOutputCol("features")
  • that was obtained from an Array of the songsTable's columns named duration, tempo and loudness using
    • setInputCols(Array("duration", "tempo", "loudness")).
trainingData.take(3) // see first 3 rows of trainingData DataFrame, notice the vectors in the last column
res3: Array[org.apache.spark.sql.Row] = Array([AR81V6H1187FB48872,0.0,0.0,,Earl Sixteen,213.7073,0.0,11,0.419,-12.106,Soldier of Jah Army,0.0,SOVNZSZ12AB018A9B8,208.289,125.882,1.0,0.0,Rastaman,2003.0,-1,[213.7073,125.882,-12.106]], [ARVVZQP11E2835DBCB,0.0,0.0,,Wavves,133.25016,0.0,0,0.282,0.596,Wavvves,0.471578247701,SOJTQHQ12A8C143C5F,128.116,89.519,1.0,0.0,I Want To See You (And Go To The Movies),2009.0,-1,[133.25016,89.519,0.596]], [ARFG9M11187FB3BBCB,0.0,0.0,Nashua USA,C-Side,247.32689,0.0,9,0.612,-4.896,Santa Festival Compilation 2008 vol.1,0.0,SOAJSQL12AB0180501,242.196,171.278,5.0,1.0,Loose on the Dancefloor,0.0,225261,[247.32689,171.278,-4.896]])

Transformers

A Transformer is an abstraction that includes feature transformers and learned models. Technically, a Transformer implements a method transform(), which converts one DataFrame into another, generally by appending one or more columns. For example:

  • A feature transformer might take a DataFrame, read a column (e.g., text), map it into a new column (e.g., feature vectors), and output a new DataFrame with the mapped column appended.
  • A learning model might take a DataFrame, read the column containing feature vectors, predict the label for each feature vector, and output a new DataFrame with predicted labels appended as a column.

Estimators

An Estimator abstracts the concept of a learning algorithm or any algorithm that fits or trains on data.

Technically, an Estimator implements a method fit(), which accepts a DataFrame and produces a Model, which is a Transformer.

For example, a learning algorithm such as LogisticRegression is an Estimator, and calling fit() trains a LogisticRegressionModel, which is a Model and hence a Transformer.

display(trainingData.select("duration", "tempo", "loudness", "features").limit(5)) // see features in more detail

Demonstration of the standard algorithm

(1) (2) (3) (4)

  1. k initial "means" (in this case k=3) are randomly generated within the data domain (shown in color).
  • k clusters are created by associating every observation with the nearest mean. The partitions here represent the Voronoi diagram generated by the means.
  • The centroid of each of the k clusters becomes the new mean.
  • Steps 2 and 3 are repeated until local convergence has been reached.

The "assignment" step 2 is also referred to as expectation step, the "update step" 3 as maximization step, making this algorithm a variant of the generalized expectation-maximization algorithm.

Caveats: As k-means is a heuristic algorithm, there is no guarantee that it will converge to the global optimum, and the result may depend on the initial clusters. As the algorithm is usually very fast, it is common to run it multiple times with different starting conditions. However, in the worst case, k-means can be very slow to converge. For more details see https://en.wikipedia.org/wiki/K-means_clustering that is also embedded in-place below.

CAUTION!

Iris flower data set, clustered using

  • k-means (left) and
  • true species in the data set (right).

k-means clustering result for the Iris flower data set and actual species visualized using ELKI. Cluster means are marked using larger, semi-transparent symbols.

Note that k-means is non-determinicstic, so results vary. Cluster means are visualized using larger, semi-transparent markers. The visualization was generated using ELKI.

With some cautionary tales we go ahead with applying k-means to our dataset next.

We can now pass this new DataFrame to the KMeans model and ask it to categorize different rows in our data to two different classes (setK(2)). We place the model in a immutable value named model.

Note: This command performs multiple spark jobs (one job per iteration in the KMeans algorithm). You will see the progress bar starting over and over again.

import org.apache.spark.ml.clustering.KMeans
val model = new KMeans().setK(2).fit(trainingData) // 37 seconds in 5 workers cluster
import org.apache.spark.ml.clustering.KMeans
model: org.apache.spark.ml.clustering.KMeansModel = KMeansModel: uid=kmeans_7370bad07a6f, k=2, distanceMeasure=euclidean, numFeatures=3
//model. // uncomment and place cursor next to . and hit Tab to see all methods on model
model.clusterCenters // get cluster centres
res5: Array[org.apache.spark.ml.linalg.Vector] = Array([208.72069181761955,124.38376303683947,-9.986137113920133], [441.1413218945455,123.00973381818183,-10.560375818181816])
val modelTransformed = model.transform(trainingData) // to get predictions as last column
modelTransformed: org.apache.spark.sql.DataFrame = [artist_id: string, artist_latitude: double ... 20 more fields]

Remember that ML Pipelines works with DataFrames. So, our trainingData and modelTransformed are both DataFrames

trainingData.printSchema
root
 |-- artist_id: string (nullable = true)
 |-- artist_latitude: double (nullable = false)
 |-- artist_longitude: double (nullable = false)
 |-- artist_location: string (nullable = true)
 |-- artist_name: string (nullable = true)
 |-- duration: double (nullable = false)
 |-- end_of_fade_in: double (nullable = false)
 |-- key: integer (nullable = false)
 |-- key_confidence: double (nullable = false)
 |-- loudness: double (nullable = false)
 |-- release: string (nullable = true)
 |-- song_hotness: double (nullable = false)
 |-- song_id: string (nullable = true)
 |-- start_of_fade_out: double (nullable = false)
 |-- tempo: double (nullable = false)
 |-- time_signature: double (nullable = false)
 |-- time_signature_confidence: double (nullable = false)
 |-- title: string (nullable = true)
 |-- year: double (nullable = false)
 |-- partial_sequence: integer (nullable = false)
 |-- features: vector (nullable = true)
modelTransformed.printSchema
root
 |-- artist_id: string (nullable = true)
 |-- artist_latitude: double (nullable = false)
 |-- artist_longitude: double (nullable = false)
 |-- artist_location: string (nullable = true)
 |-- artist_name: string (nullable = true)
 |-- duration: double (nullable = false)
 |-- end_of_fade_in: double (nullable = false)
 |-- key: integer (nullable = false)
 |-- key_confidence: double (nullable = false)
 |-- loudness: double (nullable = false)
 |-- release: string (nullable = true)
 |-- song_hotness: double (nullable = false)
 |-- song_id: string (nullable = true)
 |-- start_of_fade_out: double (nullable = false)
 |-- tempo: double (nullable = false)
 |-- time_signature: double (nullable = false)
 |-- time_signature_confidence: double (nullable = false)
 |-- title: string (nullable = true)
 |-- year: double (nullable = false)
 |-- partial_sequence: integer (nullable = false)
 |-- features: vector (nullable = true)
 |-- prediction: integer (nullable = false)
  • The column features that we specified as output column to our VectorAssembler contains the features
  • The new column prediction in modelTransformed contains the predicted output
val transformed = modelTransformed.select("duration", "tempo", "loudness", "prediction")
transformed: org.apache.spark.sql.DataFrame = [duration: double, tempo: double ... 2 more fields]

To comfortably visualize the data we produce a random sample. Remember the display() function? We can use it to produce a nicely rendered table of transformed DataFrame.

// just sampling the fraction 0.005 of all the rows at random, 
// 'false' argument to sample is for sampling without replacement
display(transformed.sample(false, fraction = 0.005, 12988934L)) 
duration tempo loudness prediction
265.97832 129.987 -5.065 0.0
306.36363 127.529 -8.273 0.0
195.73506 115.191 -6.327 0.0
257.82812 92.892 -13.621 0.0
177.55383 149.853 -10.969 0.0
224.9922 97.98 -5.921 0.0
528.09098 160.022 -5.956 1.0
213.68118 100.219 -4.528 0.0
35.52608 121.349 -18.721 0.0
213.68118 120.581 -10.633 0.0
300.53832 139.017 -13.319 0.0
138.81424 160.044 -11.138 0.0
413.962 89.588 -13.143 1.0
292.17914 188.543 -5.389 0.0
419.34322 140.008 -5.389 1.0
261.61587 152.951 -12.447 0.0
168.64608 99.617 -8.164 0.0
446.27546 196.005 -6.621 1.0
343.92771 122.877 -10.264 1.0
261.69424 145.129 -4.733 0.0
408.47628 61.259 -11.244 1.0
243.3824 161.778 -6.88 0.0
184.00608 111.461 -9.788 0.0
67.39546 188.723 -3.239 0.0
165.51138 81.125 -18.692 0.0
214.85669 144.174 -17.989 0.0
185.96526 186.897 -6.041 0.0
170.05669 75.356 -16.486 0.0
193.72363 117.131 -9.822 0.0
227.23873 91.953 -11.221 0.0
177.6322 150.962 -7.288 0.0
117.21098 100.021 -10.782 0.0
422.42567 91.214 -8.872 1.0
145.162 95.388 -10.166 0.0
242.93832 112.015 -7.135 0.0
366.00118 65.05 -13.768 1.0
601.15546 70.623 -11.179 1.0
196.17914 121.563 -5.434 0.0
399.35955 124.963 -3.415 1.0
287.73832 161.648 -14.721 0.0
285.09995 132.86 -10.23 0.0
358.32118 132.874 -6.071 1.0
407.71873 85.996 -10.103 1.0
463.25506 95.083 -6.4 1.0
295.91465 93.515 -8.987 0.0
273.8673 190.044 -10.556 0.0
280.73751 113.363 -6.893 0.0
142.65424 206.067 -7.996 0.0
197.38077 84.023 -10.964 0.0
226.24608 166.768 -5.941 0.0
152.47628 153.528 -7.393 0.0
315.32363 139.919 -7.438 0.0
329.03791 180.059 -6.473 1.0
296.88118 137.976 -5.49 0.0
250.77506 84.543 -18.058 0.0
48.14322 52.814 -11.617 0.0
290.16771 141.24 -14.009 0.0
406.04689 133.997 -9.685 1.0
124.57751 161.237 -12.314 0.0
280.45016 154.003 -8.094 0.0
472.31955 219.371 -6.08 1.0
267.4673 152.123 -18.457 0.0
216.21506 88.022 -7.096 0.0
31.00689 237.737 -11.538 0.0
283.21914 132.934 -11.153 0.0
284.21179 110.585 -15.384 0.0
154.87955 157.881 -4.377 0.0
431.46404 113.905 -8.651 1.0
215.87546 124.572 -7.67 0.0
161.43628 43.884 -14.936 0.0
29.09995 135.146 -1.837 0.0
301.68771 123.672 -9.293 0.0
170.10893 124.022 -9.589 0.0
281.96526 63.544 -8.25 0.0
484.54485 149.565 -5.501 1.0
135.1571 92.749 -7.881 0.0
180.45342 137.899 -5.246 0.0
142.44526 85.406 -11.305 0.0
209.3971 93.233 -13.079 0.0
319.9473 122.936 -5.98 0.0
55.82322 249.325 -8.656 0.0
192.88771 124.006 -5.745 0.0
624.14322 128.988 -7.872 1.0
188.49914 107.264 -13.24 0.0
148.32281 150.075 -5.793 0.0
195.00363 49.31 -14.54 0.0
130.61179 100.208 -10.487 0.0
212.11383 111.048 -4.749 0.0
204.56444 92.076 -7.906 0.0
292.04853 135.932 -9.004 0.0
377.83465 73.336 -13.457 1.0
246.96118 116.761 -8.117 0.0
90.30485 39.3 -15.444 0.0
201.92608 123.558 -9.857 0.0
282.06975 136.09 -6.202 0.0
194.55955 119.488 -16.454 0.0
318.4322 140.467 -6.375 0.0
55.45751 121.476 -7.891 0.0
275.30404 90.024 -6.191 0.0
422.24281 131.994 -8.786 1.0
269.47873 88.921 -4.419 0.0
186.01751 55.271 -16.153 0.0
221.17832 94.967 -6.591 0.0
275.66975 94.999 -16.843 0.0
335.28118 90.129 -13.33 1.0
288.88771 102.96 -10.967 0.0
190.71955 88.269 -13.167 0.0
211.17342 126.741 -10.398 0.0
116.92363 140.09 -7.578 0.0
310.282 181.753 -17.61 0.0
184.21506 112.336 -8.764 0.0
248.21506 101.988 -6.487 0.0
116.00934 84.793 -9.057 0.0
299.88526 143.66 -7.279 0.0
1376.78322 107.066 -7.893 1.0
182.85669 191.559 -10.367 0.0
238.2624 48.592 -9.687 0.0
239.5424 105.47 -9.258 0.0
195.16036 127.911 -7.054 0.0
149.73342 118.643 -10.526 0.0
424.30649 62.8 -22.35 1.0
221.77914 104.983 -7.908 0.0
407.7971 126.983 -11.675 1.0
175.04608 120.542 -17.484 0.0
306.65098 120.0 -18.973 0.0
315.0624 85.82 -11.858 0.0
88.5024 211.429 -11.543 0.0
101.61587 19.215 -26.402 0.0
132.04853 186.123 -7.21 0.0
146.25914 200.16 -15.88 0.0
147.3824 104.658 -8.836 0.0
156.26404 135.353 -8.245 0.0
66.2722 115.129 -16.416 0.0
247.43138 124.991 -11.79 0.0
282.90567 115.472 -12.448 0.0
401.05751 125.015 -9.465 1.0
156.08118 88.128 -16.916 0.0
198.08608 133.961 -8.055 0.0
214.09914 84.353 -12.991 0.0
269.73995 161.953 -3.091 0.0
199.44444 169.922 -6.241 0.0
149.65506 190.802 -30.719 0.0
227.23873 120.14 -12.39 0.0

To generate a scatter plot matrix, click on the plot button bellow the table and select scatter. That will transform your table to a scatter plot matrix. It automatically picks all numeric columns as values. To include predicted clusters, click on Plot Options and drag prediction to the list of Keys. You will get the following plot. On the diagonal panels you see the PDF of marginal distribution of each variable. Non-diagonal panels show a scatter plot between variables of the two variables of the row and column. For example the top right panel shows the scatter plot between duration and loudness. Each point is colored according to the cluster it is assigned to.

display(transformed.sample(false, fraction = 0.01)) // try fraction=1.0 as this dataset is small
duration tempo loudness prediction
244.27057 112.731 -10.505 0.0
195.47383 97.965 -11.452 0.0
63.65995 104.664 -17.248 0.0
200.202 200.191 -10.104 0.0
306.36363 127.529 -8.273 0.0
196.49261 42.746 -7.608 0.0
202.89261 131.021 -4.434 0.0
203.33669 157.886 -2.236 0.0
182.85669 157.139 -7.1 0.0
205.50485 95.979 -7.698 0.0
109.73995 113.462 -20.321 0.0
163.23873 83.005 -13.396 0.0
224.9922 97.98 -5.921 0.0
176.61342 94.052 -8.77 0.0
443.66322 125.979 -5.778 1.0
298.26567 169.845 -7.725 0.0
184.42404 78.437 -12.727 0.0
267.17995 180.542 -6.627 0.0
253.30893 94.987 -7.692 0.0
200.46322 106.733 -12.94 0.0
253.36118 86.342 -6.782 0.0
138.73587 155.904 -5.893 0.0
121.52118 86.994 -6.913 0.0
85.81179 89.253 -5.191 0.0
289.43628 95.95 -13.052 0.0
262.37342 165.932 -6.124 0.0
467.09506 138.769 -10.777 1.0
191.84281 180.105 -11.451 0.0
300.40771 163.844 -7.44 0.0
271.51628 144.111 -6.032 0.0
213.91628 105.987 -3.815 0.0
452.57098 125.01 -12.88 1.0
195.94404 56.525 -16.71 0.0
111.17669 146.334 -10.847 0.0
278.85669 112.459 -11.918 0.0
290.58567 131.844 -7.134 0.0
246.17751 95.323 -7.515 0.0
180.37506 192.659 -6.815 0.0
268.38159 156.076 -4.435 0.0
495.98649 120.467 -11.189 1.0
605.33506 145.803 -13.557 1.0
343.92771 122.877 -10.264 1.0
313.28608 137.929 -9.179 0.0
279.74485 103.98 -7.026 0.0
183.11791 101.679 -24.065 0.0
270.62812 96.544 -7.089 0.0
235.4673 111.282 -12.93 0.0
143.20281 101.104 -4.278 0.0
213.21098 110.858 -10.904 0.0
248.55465 99.389 -5.273 0.0
211.27791 106.629 -5.518 0.0
297.53424 125.142 -6.341 0.0
252.57751 98.328 -12.207 0.0
230.63465 150.118 -4.63 0.0
234.91873 100.022 -3.952 0.0
482.5073 145.1 -12.697 1.0
133.69424 145.629 -11.526 0.0
221.83138 146.375 -6.363 0.0
243.61751 131.243 -10.148 0.0
662.93506 113.008 -10.187 1.0
254.92853 111.017 -9.153 0.0
121.41669 100.339 -8.565 0.0
176.06485 125.435 -10.29 0.0
332.43383 103.119 -13.376 1.0
437.26322 104.97 -14.029 1.0
134.81751 39.42 -15.975 0.0
226.37669 140.502 -7.333 0.0
184.842 152.671 -7.156 0.0
191.45098 84.029 -9.696 0.0
248.31955 137.923 -1.57 0.0
132.91057 86.912 -10.106 0.0
252.86485 133.005 -5.409 0.0
249.10322 98.047 -6.547 0.0
170.00444 112.46 -9.011 0.0
307.59138 122.547 -12.767 0.0
200.80281 130.182 -6.988 0.0
292.64934 106.006 -3.538 0.0
139.36281 103.898 -3.788 0.0
262.13832 180.04 -6.318 0.0
214.7522 107.956 -2.691 0.0
245.4722 124.999 -6.846 0.0
268.53832 132.01 -6.298 0.0
187.14077 161.933 -10.074 0.0
215.66649 140.381 -5.111 0.0
176.92689 117.172 -9.213 0.0
555.04934 110.119 -5.311 1.0
80.48281 149.108 -11.616 0.0
162.63791 164.106 -22.073 0.0
159.65995 156.785 -12.696 0.0
198.26893 131.377 -8.376 0.0
167.33995 150.654 -7.907 0.0
183.58812 133.9 -17.413 0.0
288.70485 79.198 -12.843 0.0
77.63546 106.902 -18.099 0.0
141.26975 124.414 -8.835 0.0
276.16608 95.231 -8.471 0.0
272.56118 200.29 -11.23 0.0
207.96036 88.026 -13.496 0.0
282.06975 74.975 -11.123 0.0
526.44526 119.559 -37.527 1.0
259.97016 125.149 -12.906 0.0
159.65995 207.66 -6.344 0.0
300.7473 224.518 -6.432 0.0
304.97914 106.716 -9.78 0.0
214.04689 99.189 -4.772 0.0
231.88853 80.091 -5.629 0.0
237.97506 116.126 -10.743 0.0
182.54322 72.894 -17.837 0.0
52.11383 168.794 -6.383 0.0
158.92853 165.406 -9.687 0.0
267.33669 112.741 -25.091 0.0
261.69424 191.883 -24.9 0.0
343.06567 123.951 -6.143 1.0
534.93506 91.53 -7.688 1.0
227.83955 125.951 -6.689 0.0
186.69669 86.635 -6.139 0.0
216.18893 130.325 -12.527 0.0
230.42567 116.913 -12.477 0.0
159.55546 105.245 -23.254 0.0
202.39628 55.307 -6.039 0.0
215.74485 106.31 -8.126 0.0
336.22159 142.252 -9.546 1.0
207.67302 153.947 -4.633 0.0
289.59302 90.51 -27.653 0.0
133.32853 125.883 -10.795 0.0
183.06567 104.177 -6.329 0.0
227.082 90.997 -6.716 0.0
245.65506 160.077 -3.661 0.0
128.67873 144.519 -9.05 0.0
445.07383 124.982 -5.163 1.0
260.57098 122.819 -12.271 0.0
257.51465 142.945 -8.397 0.0
170.81424 132.335 -3.687 0.0
183.66649 87.833 -15.591 0.0
424.82893 173.814 -6.585 1.0
135.1571 92.749 -7.881 0.0
153.0771 104.976 -5.611 0.0
307.90485 147.753 -4.254 0.0
217.15546 99.508 -11.413 0.0
190.27546 127.754 -4.402 0.0
234.26567 86.654 -8.753 0.0
295.02649 127.96 -7.766 0.0
420.28363 139.991 -13.264 1.0
166.71302 208.839 -18.976 0.0
225.72363 110.028 -4.573 0.0
161.85424 91.393 -8.609 0.0
232.41098 126.606 -6.709 0.0
437.41995 147.984 -6.066 1.0
205.13914 115.028 -5.83 0.0
174.70649 100.886 -12.613 0.0
254.30159 85.012 -11.373 0.0
184.99873 119.071 -17.613 0.0
198.47791 168.829 -14.589 0.0
224.46975 124.459 -7.934 0.0
188.86485 145.123 -6.104 0.0
41.35138 173.793 -12.26 0.0
309.39383 89.986 -12.035 0.0
149.52444 173.984 -12.84 0.0
187.79383 112.146 -21.23 0.0
191.00689 146.664 -6.587 0.0
216.5024 119.576 -8.772 0.0
176.8224 73.616 -19.386 0.0
225.30567 105.067 -6.96 0.0
226.66404 91.386 -7.419 0.0
237.89669 143.888 -14.289 0.0
279.92771 124.046 -13.476 0.0
207.3073 198.496 -11.67 0.0
202.39628 93.366 -18.305 0.0
406.9873 128.419 -14.869 1.0
220.73424 157.958 -9.327 0.0
237.21751 130.013 -3.837 0.0
253.17832 89.702 -5.557 0.0
152.42404 141.991 -11.27 0.0
440.89424 127.935 -10.072 1.0
144.40444 91.946 -7.005 0.0
169.69098 103.956 -11.004 0.0
217.10322 90.379 -13.479 0.0
394.78812 127.996 -7.112 1.0
185.52118 134.03 -5.529 0.0
260.98893 85.0 -5.263 0.0
132.25751 97.619 -3.397 0.0
242.78159 149.953 -6.236 0.0
298.03057 84.896 -8.511 0.0
180.13995 92.063 -9.866 0.0
72.82893 135.059 -17.814 0.0
305.47546 130.016 -10.648 0.0
49.99791 94.143 -12.105 0.0
213.60281 157.762 -12.58 0.0
332.48608 156.616 -8.777 1.0
386.35057 120.513 -21.297 1.0
260.30975 190.015 -5.148 0.0
229.19791 164.202 -6.88 0.0
473.25995 159.997 -7.717 1.0
233.22077 101.313 -6.339 0.0
235.2322 98.591 -9.746 0.0
172.61669 102.747 -9.067 0.0
246.49098 75.408 -5.108 0.0
326.42567 36.489 -26.396 1.0
243.3824 103.205 -9.898 0.0
425.24689 131.368 -8.297 1.0
221.25669 135.04 -5.154 0.0
190.9024 107.104 -10.353 0.0
172.32934 160.707 -8.875 0.0
166.71302 127.945 -18.645 0.0
183.97995 115.659 -11.091 0.0
237.97506 116.167 -6.36 0.0
223.52934 154.645 -9.71 0.0
298.50077 126.038 -5.151 0.0
465.31873 175.035 -4.044 1.0
138.55302 85.67 -12.052 0.0
240.40444 120.03 -8.459 0.0
341.99465 141.156 -21.177 1.0
157.02159 141.477 -4.464 0.0
288.78322 95.049 -7.796 0.0
184.08444 122.905 -14.019 0.0
248.99873 211.264 -10.24 0.0
174.2624 127.693 -12.39 0.0
315.8722 143.013 -15.79 0.0
247.40526 141.204 -8.753 0.0
295.44444 85.545 -3.997 0.0
321.33179 130.964 -13.273 0.0
361.22077 133.027 -2.875 1.0
322.58567 121.964 -7.198 0.0
75.07546 116.339 -15.41 0.0
228.64934 128.01 -10.045 0.0
153.3122 101.93 -22.817 0.0
218.53995 126.607 -9.678 0.0
289.69751 107.998 -7.901 0.0
213.62893 184.052 -9.174 0.0
363.4673 114.397 -11.772 1.0
219.71546 93.135 -9.806 0.0
179.19955 129.99 -9.664 0.0
293.35465 144.596 -7.363 0.0
180.94975 157.921 -5.232 0.0
277.89016 57.623 -17.473 0.0
210.99057 163.841 -16.969 0.0
264.202 120.034 -19.802 0.0
194.42893 188.35 -9.564 0.0
258.61179 92.829 -8.928 0.0
176.37832 99.829 -11.923 0.0
247.11791 134.445 -2.932 0.0
252.3424 164.599 -7.585 0.0
159.21587 104.799 -10.143 0.0
479.11138 125.125 -12.127 1.0
268.9824 140.062 -10.898 0.0
374.77832 180.044 -10.436 1.0
428.22485 127.982 -17.48 1.0
817.05751 145.897 -5.303 1.0
198.63465 166.593 -3.315 0.0
192.36526 90.019 -6.396 0.0
151.77098 187.791 -8.472 0.0
164.20526 191.878 -4.388 0.0
301.73995 112.045 -17.254 0.0
282.30485 83.331 -10.754 0.0
371.48689 104.993 -9.919 1.0
119.06567 173.919 -6.858 0.0
283.6371 69.909 -17.178 0.0
261.69424 98.007 -21.256 0.0
280.13669 128.037 -4.909 0.0
124.31628 200.182 -7.938 0.0
241.37098 128.527 -4.834 0.0
299.02322 109.944 -9.461 0.0
461.21751 160.027 -13.182 1.0
108.72118 115.168 -12.621 0.0
182.09914 161.077 -6.536 0.0
161.04444 240.577 -5.114 0.0
233.01179 145.232 -10.703 0.0
237.92281 140.481 -7.453 0.0
237.29587 98.184 -8.888 0.0
258.61179 96.752 -13.219 0.0
45.76608 112.436 -20.112 0.0
164.77995 209.448 -0.438 0.0
196.38812 176.511 -6.945 0.0
264.09751 125.995 -11.854 0.0
318.87628 130.011 -6.758 0.0
133.90322 137.567 -4.931 0.0
265.53424 88.519 -11.095 0.0
170.68363 167.807 -9.308 0.0
243.64363 127.97 -7.569 0.0
280.0322 147.816 -4.771 0.0
525.29587 85.619 -12.152 1.0
457.32526 127.983 -6.449 1.0
349.07383 125.798 -11.251 1.0
display(transformed.sample(false, fraction = 0.01)) // try fraction=1.0 as this dataset is small
duration tempo loudness prediction
189.93587 134.957 -12.934 0.0
206.44526 135.26 -11.146 0.0
295.65342 137.904 -7.308 0.0
158.1971 174.831 -12.544 0.0
259.99628 171.094 -12.057 0.0
277.002 88.145 -6.039 0.0
1518.65424 65.003 -19.182 1.0
121.73016 85.041 -8.193 0.0
205.97506 106.952 -6.572 0.0
206.18404 89.447 -9.535 0.0
202.52689 134.13 -6.535 0.0
259.02975 97.948 -11.276 0.0
308.53179 80.017 -12.277 0.0
151.71873 117.179 -12.394 0.0
165.56363 99.187 -11.414 0.0
370.83383 67.495 -20.449 1.0
238.65424 100.071 -9.276 0.0
163.7873 119.924 -5.941 0.0
279.32689 67.371 -26.67 0.0
353.85424 68.405 -8.105 1.0
227.23873 117.62 -7.874 0.0
195.49995 85.916 -8.828 0.0
322.45506 135.826 -5.034 0.0
235.88526 109.773 -10.919 0.0
235.15383 163.924 -9.666 0.0
253.67465 125.014 -7.171 0.0
415.03302 71.991 -15.224 1.0
190.85016 152.805 -2.871 0.0
290.76853 84.841 -6.161 0.0
346.8273 129.981 -10.377 1.0
174.70649 143.446 -11.994 0.0
170.84036 70.033 -7.782 0.0
517.66812 151.948 -12.363 1.0
62.06649 154.406 -9.387 0.0
505.96526 90.59 -19.848 1.0
480.86159 0.0 -11.707 1.0
330.13506 204.534 -9.85 1.0
223.99955 110.3 -12.339 0.0
200.98567 89.215 -3.858 0.0
158.09261 178.826 -13.681 0.0
186.46159 110.102 -16.477 0.0
399.46404 125.03 -10.786 1.0
118.64771 85.747 -34.461 0.0
352.49587 91.139 -9.13 1.0
150.15138 106.364 -7.337 0.0
158.98077 124.54 -17.405 0.0
122.17424 170.018 -9.047 0.0
299.38893 91.976 -6.266 0.0
197.95546 142.744 -8.189 0.0
332.38159 89.071 -5.08 1.0
309.78567 136.05 -15.105 0.0
198.47791 82.546 -12.594 0.0
254.17098 144.01 -9.0 0.0
155.81995 233.022 -8.978 0.0
176.53506 136.255 -9.675 0.0
331.54567 221.511 -13.778 1.0
140.72118 162.44 -10.654 0.0
210.9122 120.039 -5.391 0.0
197.27628 119.396 -22.599 0.0
339.25179 96.842 -16.207 1.0
355.97016 142.777 -5.118 1.0
170.23955 55.107 -17.654 0.0
360.01914 119.997 -7.53 1.0
241.76281 101.938 -3.765 0.0
84.92363 236.863 -15.846 0.0
361.09016 120.121 -5.861 1.0
262.37342 89.924 -4.819 0.0
225.74975 139.994 -11.505 0.0
246.9873 172.147 -16.273 0.0
159.242 166.855 -4.771 0.0
192.86159 148.297 -13.423 0.0
140.90404 92.602 -12.604 0.0
224.20853 71.879 -16.615 0.0
235.78077 180.366 -3.918 0.0
244.45342 105.077 -5.004 0.0
210.57261 200.044 -11.381 0.0
327.3922 112.023 -11.341 1.0
168.38485 99.991 -4.1 0.0
287.13751 137.154 -12.948 0.0
148.63628 121.773 -11.432 0.0
214.7522 124.437 -5.834 0.0
197.43302 92.959 -4.948 0.0
150.17751 112.0 -5.968 0.0
152.86812 120.884 -15.693 0.0
173.322 120.827 -7.96 0.0
235.15383 85.519 -8.172 0.0
299.41506 94.68 -15.486 0.0
222.35383 156.046 -8.885 0.0
235.85914 130.055 -5.341 0.0
276.71465 170.059 -2.926 0.0
136.07138 168.895 -6.971 0.0
205.7922 129.57 -6.113 0.0
268.72118 126.894 -7.142 0.0
390.63465 232.08 -5.493 1.0
242.59873 124.034 -11.24 0.0
274.80771 108.178 -21.456 0.0
157.25669 151.108 -11.678 0.0
203.67628 140.02 -5.939 0.0
302.47138 148.2 -10.428 0.0
292.64934 106.006 -3.538 0.0
245.002 135.997 -10.6 0.0
181.57669 132.89 -5.429 0.0
36.38812 65.132 -12.621 0.0
656.14322 95.469 -8.588 1.0
262.50404 88.025 -4.359 0.0
261.95546 117.93 -5.5 0.0
337.57995 122.08 -6.658 1.0
373.08036 126.846 -10.115 1.0
220.36853 157.934 -13.192 0.0
357.22404 199.889 -9.832 1.0
663.61424 143.681 -9.066 1.0
155.08853 201.152 -7.43 0.0
264.56771 133.7 -11.767 0.0
262.53016 105.041 -3.933 0.0
386.61179 132.644 -8.34 1.0
224.41751 93.333 -12.001 0.0
264.25424 117.547 -6.134 0.0
12.82567 99.229 -29.527 0.0
470.25587 135.99 -7.403 1.0
213.7073 92.584 -8.398 0.0
50.59873 108.989 -10.006 0.0
273.162 114.014 -8.527 0.0
285.1522 101.877 -9.361 0.0
267.88526 123.903 -10.177 0.0
334.54975 138.386 -7.389 1.0
174.0273 95.084 -21.944 0.0
242.15465 87.196 -9.749 0.0
188.96934 188.967 -3.288 0.0
480.67873 127.989 -7.243 1.0
182.54322 72.894 -17.837 0.0
231.1571 126.959 -5.632 0.0
105.37751 136.156 -13.607 0.0
125.88363 93.022 -13.496 0.0
216.99873 151.866 -7.47 0.0
176.50893 142.601 -3.881 0.0
245.57669 123.186 -3.609 0.0
191.37261 145.008 -14.3 0.0
62.11873 80.961 -12.453 0.0
274.80771 83.505 -10.032 0.0
148.29669 92.154 -13.542 0.0
241.47546 115.886 -11.948 0.0
250.40934 100.001 -18.335 0.0
154.56608 96.464 -12.133 0.0
485.14567 84.633 -8.812 1.0
307.22567 63.498 -9.047 0.0
167.78404 122.92 -13.528 0.0
345.10322 130.003 -7.858 1.0
178.9122 111.13 -7.33 0.0
237.29587 111.244 -15.209 0.0
230.16444 74.335 -12.244 0.0
230.50404 98.933 -12.616 0.0
195.16036 131.037 -12.769 0.0
130.01098 99.176 -11.082 0.0
150.02077 97.501 -2.945 0.0
239.64689 89.99 -9.224 0.0
91.6371 71.187 -16.523 0.0
136.88118 121.19 -12.181 0.0
265.29914 167.132 -13.859 0.0
166.84363 76.298 -7.692 0.0
34.79465 109.386 -13.591 0.0
344.29342 138.826 -12.746 1.0
294.71302 123.963 -15.225 0.0
232.9073 100.264 -7.171 0.0
501.68118 126.947 -8.972 1.0
163.00363 154.296 -19.387 0.0
186.51383 89.989 -5.338 0.0
279.30077 130.522 -11.813 0.0
202.78812 79.515 -26.44 0.0
123.45424 129.987 -14.751 0.0
237.08689 82.135 -6.347 0.0
239.75138 169.111 -7.915 0.0
105.87383 145.028 -2.414 0.0
250.46159 123.306 -5.113 0.0
227.68281 132.51 -6.661 0.0
487.44444 100.065 -16.668 1.0
247.17016 165.886 -8.476 0.0
194.92526 99.414 -7.516 0.0
174.602 194.079 -4.611 0.0
199.96689 148.78 -9.657 0.0
278.7522 185.291 -10.58 0.0
147.82649 88.634 -3.83 0.0
166.1122 106.748 -10.875 0.0
150.67383 120.367 -14.628 0.0
237.53098 127.24 -27.291 0.0
174.10567 124.185 -6.983 0.0
84.84526 98.321 -4.167 0.0
287.50322 121.821 -9.951 0.0
142.23628 184.994 -16.834 0.0
85.91628 180.788 -9.972 0.0
217.23383 108.892 -7.211 0.0
233.63873 113.878 -6.394 0.0
291.94404 91.976 -6.998 0.0
502.5171 140.015 -5.285 1.0
316.02893 97.508 -10.52 0.0
408.58077 176.977 -15.701 1.0
244.13995 156.187 -5.985 0.0
146.46812 140.032 -13.347 0.0
131.05587 114.198 -23.084 0.0
175.80363 137.052 -7.147 0.0
230.53016 115.496 -3.953 0.0
247.92771 90.092 -10.103 0.0
207.04608 132.94 -7.325 0.0
163.70893 77.698 -18.806 0.0
179.722 81.884 -40.036 0.0
214.02077 87.003 -4.724 0.0
379.68934 127.986 -8.715 1.0
173.322 74.929 -3.089 0.0
263.81016 131.945 -6.911 0.0
244.21832 109.004 -3.762 0.0
220.1073 99.948 -14.54 0.0
298.37016 87.591 -31.42 0.0
273.97179 169.372 -10.764 0.0
229.74649 117.184 -6.174 0.0
383.68608 127.261 -3.975 1.0
278.02077 47.779 -4.486 0.0
135.75791 164.977 -5.974 0.0
373.75955 129.057 -8.391 1.0
272.40444 162.882 -14.916 0.0
164.93669 120.317 -11.476 0.0
242.99057 103.45 -16.493 0.0
248.24118 116.026 -6.973 0.0
304.61342 212.051 -17.131 0.0
228.91057 91.879 -23.314 0.0
308.50567 118.188 -7.159 0.0
419.83955 125.007 -11.017 1.0
189.67465 193.129 -8.674 0.0
242.28526 69.129 -16.121 0.0
213.02812 126.919 -8.439 0.0
290.16771 135.96 -7.305 0.0
143.12444 100.706 -12.15 0.0
278.22975 103.227 -7.35 0.0
260.30975 190.015 -5.148 0.0
112.53506 128.054 -18.969 0.0
248.78975 102.113 -7.149 0.0
178.33751 147.659 -3.494 0.0
242.83383 72.278 -11.75 0.0
226.97751 100.012 -4.935 0.0
172.61669 102.747 -9.067 0.0
188.96934 110.208 -7.915 0.0
129.35791 183.983 -7.223 0.0
169.45587 91.872 -5.507 0.0
57.67791 104.328 -9.213 0.0
294.47791 107.29 -6.285 0.0
372.79302 124.018 -8.312 1.0
226.82077 132.001 -5.636 0.0
171.25832 111.129 -10.311 0.0
130.61179 204.936 -9.571 0.0
123.48036 171.624 -7.069 0.0
230.86975 154.048 -4.541 0.0
181.26322 120.07 -3.623 0.0
102.79138 113.374 -13.804 0.0
385.64526 116.331 -6.748 1.0
193.69751 112.542 -4.375 0.0
249.20771 146.99 -7.306 0.0
172.64281 119.993 -9.333 0.0
152.45016 95.981 -12.144 0.0
142.75873 86.66 -14.115 0.0
413.20444 123.564 -10.417 1.0
208.87465 134.331 -14.099 0.0
200.51546 165.825 -12.445 0.0
337.6322 115.649 -11.181 1.0
222.9024 75.527 -15.198 0.0
221.77914 104.983 -7.908 0.0
262.922 156.13 -13.043 0.0
206.602 236.05 -3.612 0.0
277.9424 147.967 -8.768 0.0
139.4673 159.421 -18.781 0.0
167.73179 161.62 -11.271 0.0
205.71383 190.11 -3.171 0.0
308.55791 92.008 -11.944 0.0
184.89424 111.551 -11.777 0.0
162.42893 83.324 -15.155 0.0
150.04689 119.14 -23.358 0.0
217.15546 128.463 -3.67 0.0
156.49914 155.053 -3.135 0.0
720.74404 113.527 -11.96 1.0
429.84444 146.456 -10.661 1.0
258.61179 92.829 -8.928 0.0
210.31138 86.073 -16.77 0.0
263.02649 98.531 -27.825 0.0
167.49669 90.052 -10.736 0.0
358.08608 63.867 -12.322 1.0
326.19057 140.026 -4.9 1.0
418.42893 85.351 -7.587 1.0
192.13016 147.428 -8.522 0.0
180.61016 89.582 -12.25 0.0
194.21995 137.415 -21.924 0.0
194.5073 169.757 -10.502 0.0
260.64934 193.875 -7.698 0.0
246.38649 142.081 -7.517 0.0
237.40036 196.665 -9.895 0.0
183.71873 124.706 -28.112 0.0
125.64853 94.467 -4.691 0.0
217.0771 98.966 -4.5 0.0
297.22077 107.963 -16.542 0.0
153.57342 93.931 -15.579 0.0
258.35057 145.774 -7.775 0.0
213.13261 86.633 -7.306 0.0
215.66649 111.961 -5.529 0.0
84.4273 74.848 -22.231 0.0
215.87546 105.793 -8.988 0.0
165.48526 127.001 -13.785 0.0
399.33342 161.057 -3.206 1.0
367.93424 119.991 -6.123 1.0
313.44281 129.342 -10.202 0.0
295.67955 114.641 -9.913 0.0
196.5971 96.798 -14.001 0.0
191.4771 100.248 -5.114 0.0
313.44281 102.699 -7.444 0.0
205.11302 93.238 -6.034 0.0
81.42322 207.494 -24.804 0.0
188.78649 194.439 -9.626 0.0
308.24444 145.975 -6.359 0.0
411.92444 237.466 -9.633 1.0
256.86159 131.837 -11.147 0.0
38.45179 73.214 -14.797 0.0
264.77669 130.674 -4.721 0.0
212.4273 116.029 -2.106 0.0
displayHTML(frameIt("https://en.wikipedia.org/wiki/Euclidean_space",500)) // make sure you run the cell with first wikipedia article!

Do you see the problem in our clusters based on the plot?

As you can see there is very little "separation" (in the sense of being separable into two point clouds, that represent our two identifed clusters, such that they have minimal overlay of these two features, i.e. tempo and loudness. NOTE that this sense of "pairwise separation" is a 2D projection of all three features in 3D Euclidean Space, i.e. loudness, tempo and duration, that depends directly on their two-dimensional visually sense-making projection of perhaps two important song features, as depicted in the corresponding 2D-scatter-plot of tempo versus loudness within the 2D scatter plot matrix that is helping us to partially visualize in the 2D-plane all of the three features in the three dimensional real-valued feature space that was the input to our K-Means algorithm) between loudness, and tempo and generated clusters. To see that, focus on the panels in the first and second columns of the scatter plot matrix. For varying values of loudness and tempo prediction does not change. Instead, duration of a song alone predicts what cluster it belongs to. Why is that?

To see the reason, let's take a look at the marginal distribution of duration in the next cell.

To produce this plot, we have picked histogram from the plots menu and in Plot Options we chose prediction as key and duration as value. The histogram plot shows significant skew in duration. Basically there are a few very long songs. These data points have large leverage on the mean function (what KMeans uses for clustering).

display(transformed.sample(false, fraction = 1.0).select("duration", "prediction")) // plotting over all results
duration prediction
213.7073 0.0
133.25016 0.0
247.32689 0.0
337.05751 1.0
430.23628 1.0
186.80118 0.0
361.89995 1.0
220.00281 0.0
156.86485 0.0
256.67873 0.0
204.64281 0.0
112.48281 0.0
170.39628 0.0
215.95383 0.0
303.62077 0.0
266.60526 0.0
326.19057 1.0
51.04281 0.0
129.4624 0.0
253.33506 0.0
237.76608 0.0
132.96281 0.0
399.35955 1.0
168.75057 0.0
396.042 1.0
192.10404 0.0
12.2771 0.0
367.56853 1.0
189.93587 0.0
233.50812 0.0
462.68036 1.0
202.60526 0.0
241.52771 0.0
275.64363 0.0
350.69342 1.0
166.55628 0.0
249.49506 0.0
53.86404 0.0
233.76934 0.0
275.12118 0.0
191.13751 0.0
299.07546 0.0
468.74077 1.0
110.34077 0.0
234.78812 0.0
705.25342 1.0
383.52934 1.0
196.10077 0.0
299.20608 0.0
94.04036 0.0
28.08118 0.0
207.93424 0.0
152.0322 0.0
207.96036 0.0
371.25179 1.0
288.93995 0.0
235.93751 0.0
505.70404 1.0
177.57995 0.0
376.842 1.0
266.84036 0.0
270.8371 0.0
178.18077 0.0
527.17669 1.0
244.27057 0.0
436.47955 1.0
236.79955 0.0
134.53016 0.0
181.002 0.0
239.41179 0.0
72.98567 0.0
214.36036 0.0
150.59546 0.0
152.45016 0.0
218.17424 0.0
290.63791 0.0
149.05424 0.0
440.21506 1.0
212.34893 0.0
278.67383 0.0
269.60934 0.0
182.69995 0.0
207.882 0.0
102.50404 0.0
437.60281 1.0
216.11057 0.0
193.25342 0.0
234.16118 0.0
695.77098 1.0
297.58649 0.0
265.37751 0.0
182.85669 0.0
202.23955 0.0
390.08608 1.0
242.78159 0.0
242.54649 0.0
496.66567 1.0
395.36281 1.0
234.89261 0.0
237.84444 0.0
313.57342 0.0
489.22077 1.0
239.98649 0.0
128.65261 0.0
193.07057 0.0
144.19546 0.0
196.96281 0.0
222.06649 0.0
58.38322 0.0
346.14812 1.0
406.54322 1.0
304.09098 0.0
180.21832 0.0
213.41995 0.0
323.44771 0.0
54.7522 0.0
437.02812 1.0
268.7473 0.0
104.75057 0.0
248.60689 0.0
221.41342 0.0
237.81832 0.0
216.34567 0.0
78.94159 0.0
47.22893 0.0
202.00444 0.0
293.56363 0.0
206.44526 0.0
267.78077 0.0
187.27138 0.0
249.05098 0.0
221.51791 0.0
452.88444 1.0
163.76118 0.0
257.17506 0.0
235.78077 0.0
257.82812 0.0
195.34322 0.0
478.1971 1.0
268.01587 0.0
136.93342 0.0
397.53098 1.0
194.69016 0.0
580.80608 1.0
177.71057 0.0
257.43628 0.0
184.13669 0.0
64.57424 0.0
123.92444 0.0
257.07057 0.0
219.48036 0.0
679.41832 1.0
252.29016 0.0
311.90159 0.0
252.76036 0.0
138.94485 0.0
428.64281 1.0
295.31383 0.0
212.03546 0.0
426.50077 1.0
197.11955 0.0
191.55546 0.0
187.53261 0.0
184.97261 0.0
388.41424 1.0
218.90567 0.0
246.49098 0.0
452.88444 1.0
223.18975 0.0
245.2371 0.0
148.92363 0.0
362.81424 1.0
171.44118 0.0
207.72526 0.0
191.29424 0.0
208.50893 0.0
240.24771 0.0
373.44608 1.0
172.01587 0.0
153.25995 0.0
242.36363 0.0
177.55383 0.0
263.20934 0.0
191.03302 0.0
232.77669 0.0
220.65587 0.0
132.57098 0.0
189.6224 0.0
32.522 0.0
173.94893 0.0
268.01587 0.0
91.97669 0.0
215.77098 0.0
195.47383 0.0
234.81424 0.0
110.78485 0.0
155.74159 0.0
172.5122 0.0
227.76118 0.0
233.01179 0.0
298.89261 0.0
245.36771 0.0
276.08771 0.0
375.77098 1.0
273.71057 0.0
226.92526 0.0
196.46649 0.0
199.65342 0.0
243.40853 0.0
207.62077 0.0
252.73424 0.0
244.32281 0.0
152.65914 0.0
203.88526 0.0
120.16281 0.0
214.77832 0.0
204.9824 0.0
118.30812 0.0
205.26975 0.0
499.22567 1.0
217.83465 0.0
192.57424 0.0
328.09751 1.0
298.03057 0.0
501.49832 1.0
276.40118 0.0
507.55873 1.0
191.08526 0.0
324.38812 0.0
218.56608 0.0
232.30649 0.0
295.05261 0.0
225.74975 0.0
522.00444 1.0
245.86404 0.0
263.67955 0.0
556.61669 1.0
227.94404 0.0
83.82649 0.0
242.85995 0.0
233.09016 0.0
201.74322 0.0
476.15955 1.0
370.93832 1.0
229.17179 0.0
288.07791 0.0
91.34975 0.0
230.79138 0.0
256.46975 0.0
203.44118 0.0
230.81751 0.0
272.29995 0.0
201.22077 0.0
204.93016 0.0
372.84526 1.0
63.65995 0.0
412.15955 1.0
270.10567 0.0
104.6722 0.0
214.25587 0.0
230.05995 0.0
155.74159 0.0
218.04363 0.0
357.77261 1.0
318.27546 0.0
444.55138 1.0
509.07383 1.0
176.95302 0.0
95.34649 0.0
207.67302 0.0
256.67873 0.0
252.78649 0.0
234.60526 0.0
167.65342 0.0
266.16118 0.0
188.05506 0.0
229.14567 0.0
227.00363 0.0
74.50077 0.0
222.09261 0.0
212.68853 0.0
155.74159 0.0
153.65179 0.0
548.51873 1.0
445.90975 1.0
317.49179 0.0
140.32934 0.0
309.4722 0.0
142.91546 0.0
429.24363 1.0
172.19873 0.0
215.562 0.0
290.79465 0.0
197.04118 0.0
309.44608 0.0
265.01179 0.0
257.64526 0.0
203.54567 0.0
161.56689 0.0
177.84118 0.0
260.04853 0.0
195.00363 0.0
268.042 0.0
195.97016 0.0
351.92118 1.0
119.35302 0.0
177.24036 0.0
259.83955 0.0
222.51057 0.0
163.97016 0.0
139.49342 0.0
158.77179 0.0
193.4624 0.0
131.082 0.0
190.95465 0.0
413.3873 1.0
134.73914 0.0
162.40281 0.0
243.59138 0.0
180.84526 0.0
315.14077 0.0
221.51791 0.0
122.53995 0.0
243.43465 0.0
200.202 0.0
95.50322 0.0
200.4371 0.0
186.93179 0.0
492.22485 1.0
359.33995 1.0
89.39057 0.0
212.81914 0.0
315.03628 0.0
214.69995 0.0
137.92608 0.0
559.49016 1.0
382.14485 1.0
430.31465 1.0
171.25832 0.0
210.12853 0.0
53.18485 0.0
78.65424 0.0
209.162 0.0
237.60934 0.0
184.47628 0.0
323.02975 0.0
158.27546 0.0
213.86404 0.0
470.69995 1.0
229.79873 0.0
392.22812 1.0
196.62322 0.0
80.97914 0.0
124.55138 0.0
230.32118 0.0
132.51873 0.0
112.95302 0.0
131.52608 0.0
153.25995 0.0
211.01669 0.0
218.93179 0.0
175.0722 0.0
116.61016 0.0
251.45424 0.0
269.50485 0.0
231.47057 0.0
298.37016 0.0
314.122 0.0
263.99302 0.0
480.91383 1.0
305.10975 0.0
280.16281 0.0
295.65342 0.0
411.45424 1.0
265.97832 0.0
153.96526 0.0
210.31138 0.0
241.44934 0.0
235.33669 0.0
352.65261 1.0
293.35465 0.0
243.66975 0.0
133.22404 0.0
233.03791 0.0
339.93098 1.0
249.80853 0.0
253.72689 0.0
94.35383 0.0
130.63791 0.0
195.36934 0.0
229.25016 0.0
314.64444 0.0
329.1424 1.0
224.46975 0.0
215.562 0.0
236.85179 0.0
197.11955 0.0
251.76771 0.0
183.50975 0.0
268.01587 0.0
413.02159 1.0
385.17506 1.0
358.16444 1.0
164.77995 0.0
253.36118 0.0
196.49261 0.0
157.6224 0.0
310.93506 0.0
434.96444 1.0
157.04771 0.0
266.16118 0.0
267.59791 0.0
303.90812 0.0
277.18485 0.0
272.22159 0.0
155.95057 0.0
127.00689 0.0
152.86812 0.0
224.7571 0.0
175.41179 0.0
151.97995 0.0
199.99302 0.0
251.53261 0.0
252.96934 0.0
181.13261 0.0
195.49995 0.0
328.202 1.0
187.71546 0.0
166.94812 0.0
242.72934 0.0
218.80118 0.0
205.68771 0.0
146.93832 0.0
449.4624 1.0
503.40526 1.0
181.34159 0.0
143.90812 0.0
406.36036 1.0
269.87057 0.0
265.29914 0.0
242.88608 0.0
110.39302 0.0
262.84363 0.0
334.00118 1.0
173.81832 0.0
608.78322 1.0
197.22404 0.0
163.94404 0.0
93.09995 0.0
206.75873 0.0
183.50975 0.0
402.442 1.0
735.79057 1.0
233.19465 0.0
326.55628 1.0
525.50485 1.0
396.19873 1.0
171.12771 0.0
318.1971 0.0
323.70893 0.0
526.99383 1.0
161.09669 0.0
168.41098 0.0
249.57342 0.0
405.4722 1.0
271.0722 0.0
190.69342 0.0
151.61424 0.0
121.57342 0.0
117.08036 0.0
244.24444 0.0
246.85669 0.0
144.03873 0.0
169.79546 0.0
193.93261 0.0
325.77261 1.0
337.34485 1.0
143.67302 0.0
211.69587 0.0
299.4673 0.0
159.76444 0.0
337.31873 1.0
259.18649 0.0
221.64853 0.0
164.54485 0.0
56.34567 0.0
184.21506 0.0
249.23383 0.0
127.29424 0.0
306.6771 0.0
168.98567 0.0
290.2722 0.0
182.33424 0.0
180.92363 0.0
233.76934 0.0
423.70567 1.0
139.36281 0.0
289.72363 0.0
100.96281 0.0
153.05098 0.0
129.25342 0.0
190.11873 0.0
158.1971 0.0
234.94485 0.0
256.02567 0.0
279.84934 0.0
217.7824 0.0
271.62077 0.0
372.34893 1.0
264.88118 0.0
270.18404 0.0
42.86649 0.0
247.27465 0.0
185.10322 0.0
333.94893 1.0
380.49914 1.0
517.72036 1.0
208.95302 0.0
359.73179 1.0
378.72281 1.0
110.41914 0.0
237.37424 0.0
136.30649 0.0
153.73016 0.0
209.8673 0.0
224.86159 0.0
202.34404 0.0
229.43302 0.0
300.56444 0.0
264.35873 0.0
213.9424 0.0
164.77995 0.0
206.75873 0.0
249.73016 0.0
521.11628 1.0
240.09098 0.0
347.89832 1.0
224.96608 0.0
250.25261 0.0
419.00363 1.0
593.3971 1.0
269.89669 0.0
235.12771 0.0
180.76689 0.0
304.03873 0.0
253.36118 0.0
311.74485 0.0
353.43628 1.0
337.00526 1.0
305.00526 0.0
113.76281 0.0
379.74159 1.0
258.76853 0.0
157.64853 0.0
352.28689 1.0
221.51791 0.0
249.44281 0.0
205.42649 0.0
166.922 0.0
250.25261 0.0
224.73098 0.0
316.83873 0.0
269.34812 0.0
188.02893 0.0
276.87138 0.0
263.02649 0.0
320.44363 0.0
531.43465 1.0
126.85016 0.0
232.01914 0.0
243.87873 0.0
288.60036 0.0
817.57995 1.0
200.9073 0.0
229.48526 0.0
263.65342 0.0
209.71057 0.0
430.54975 1.0
531.9571 1.0
277.39383 0.0
253.41342 0.0
538.5922 1.0
187.34975 0.0
189.67465 0.0
247.66649 0.0
196.15302 0.0
248.45016 0.0
266.26567 0.0
174.41914 0.0
241.21424 0.0
213.39383 0.0
201.66485 0.0
141.16526 0.0
198.76526 0.0
234.03057 0.0
293.77261 0.0
149.83791 0.0
193.09669 0.0
416.62649 1.0
206.18404 0.0
292.15302 0.0
209.55383 0.0
303.46404 0.0
284.31628 0.0
209.34485 0.0
131.34322 0.0
127.16363 0.0
228.98893 0.0
18.18077 0.0
202.762 0.0
475.21914 1.0
434.52036 1.0
306.36363 0.0
251.84608 0.0
392.80281 1.0
191.63383 0.0
207.90812 0.0
298.86649 0.0
195.36934 0.0
236.06812 0.0
315.76771 0.0
214.5171 0.0
140.90404 0.0
147.66975 0.0
230.50404 0.0
259.99628 0.0
234.70975 0.0
191.97342 0.0
305.6322 0.0
197.53751 0.0
152.05832 0.0
360.82893 1.0
440.37179 1.0
211.09506 0.0
362.60526 1.0
364.64281 1.0
267.12771 0.0
380.81261 1.0
248.13669 0.0
253.20444 0.0
244.03546 0.0
159.13751 0.0
246.12526 0.0
40.95955 0.0
200.04526 0.0
155.08853 0.0
144.66567 0.0
170.86649 0.0
286.71955 0.0
333.19138 1.0
542.1971 1.0
222.37995 0.0
195.68281 0.0
440.00608 1.0
223.08526 0.0
378.98404 1.0
91.45424 0.0
114.65098 0.0
218.80118 0.0
242.36363 0.0
143.0722 0.0
242.78159 0.0
256.31302 0.0
244.37506 0.0
36.54485 0.0
401.94567 1.0
178.65098 0.0
277.002 0.0
288.70485 0.0
228.91057 0.0
204.06812 0.0
212.40118 0.0
224.31302 0.0
195.7873 0.0
244.63628 0.0
241.81506 0.0
224.10404 0.0
132.75383 0.0
113.3971 0.0
237.03465 0.0
162.58567 0.0
247.24853 0.0
285.30893 0.0
318.24934 0.0
375.53587 1.0
188.78649 0.0
108.79955 0.0
270.91546 0.0
249.23383 0.0
192.80934 0.0
295.20934 0.0
177.84118 0.0
242.6771 0.0
245.28934 0.0
105.61261 0.0
329.29914 1.0
207.46404 0.0
225.51465 0.0
123.8722 0.0
270.10567 0.0
174.86322 0.0
377.28608 1.0
220.18567 0.0
1190.53016 1.0
1518.65424 1.0
438.64771 1.0
344.842 1.0
76.48608 0.0
174.52363 0.0
581.14567 1.0
177.68444 0.0
125.962 0.0
160.39138 0.0
211.27791 0.0
182.88281 0.0
261.53751 0.0
285.80526 0.0
263.44444 0.0
133.32853 0.0
313.99138 0.0
199.18322 0.0
200.98567 0.0
170.84036 0.0
194.48118 0.0
241.65832 0.0
245.15873 0.0
262.66077 0.0
307.46077 0.0
295.20934 0.0
259.52608 0.0
347.19302 1.0
206.91546 0.0
399.51628 1.0
271.25506 0.0
172.7473 0.0
231.65342 0.0
208.1171 0.0
195.76118 0.0
723.27791 1.0
282.95791 0.0
153.12934 0.0
207.15057 0.0
174.41914 0.0
269.29587 0.0
275.3824 0.0
149.41995 0.0
108.35546 0.0
243.69587 0.0
308.27057 0.0
204.90404 0.0
311.24853 0.0
164.77995 0.0
449.51465 1.0
140.93016 0.0
165.22404 0.0
53.26322 0.0
218.80118 0.0
300.85179 0.0
388.75383 1.0
150.77832 0.0
293.11955 0.0
177.71057 0.0
184.11057 0.0
225.17506 0.0
272.19546 0.0
157.67465 0.0
204.61669 0.0
93.98812 0.0
204.45995 0.0
307.1473 0.0
347.0624 1.0
184.73751 0.0
146.65098 0.0
513.90649 1.0
293.85098 0.0
121.73016 0.0
86.72608 0.0
171.25832 0.0
264.95955 0.0
411.68934 1.0
190.79791 0.0
159.65995 0.0
162.89914 0.0
205.97506 0.0
204.59057 0.0
117.02812 0.0
135.28771 0.0
163.65669 0.0
254.95465 0.0
178.31138 0.0
150.77832 0.0
410.53995 1.0
222.30159 0.0
314.74893 0.0
233.11628 0.0
226.21995 0.0
441.67791 1.0
120.99873 0.0
157.75302 0.0
203.65016 0.0
287.73832 0.0
226.7424 0.0
69.56363 0.0
174.52363 0.0
363.67628 1.0
136.48934 0.0
390.60853 1.0
284.60363 0.0
291.81342 0.0
502.7522 1.0
197.27628 0.0
329.53424 1.0
340.1922 1.0
170.94485 0.0
113.57995 0.0
205.24363 0.0
169.22077 0.0
285.70077 0.0
221.23057 0.0
310.38649 0.0
353.48853 1.0
415.92118 1.0
150.59546 0.0
236.90404 0.0
227.42159 0.0
229.8771 0.0
359.3922 1.0
403.17342 1.0
296.59383 0.0
117.65506 0.0
241.3971 0.0
34.92526 0.0
188.31628 0.0
409.02485 1.0
335.5424 1.0
354.63791 1.0
213.31546 0.0
238.62812 0.0
193.33179 0.0
225.33179 0.0
166.84363 0.0
79.96036 0.0
158.69342 0.0
176.53506 0.0
347.61098 1.0
106.39628 0.0
147.93098 0.0
446.92853 1.0
360.22812 1.0
214.56934 0.0
325.35465 1.0
413.23057 1.0
218.04363 0.0
215.30077 0.0
57.44281 0.0
247.48363 0.0
793.25995 1.0
467.3824 1.0
327.00036 1.0
232.72444 0.0
251.68934 0.0
197.3024 0.0
193.88036 0.0
383.32036 1.0
269.71383 0.0
255.05914 0.0
337.18812 1.0
240.92689 0.0
206.18404 0.0
143.22893 0.0
244.27057 0.0
83.56526 0.0
428.40771 1.0
261.11955 0.0
208.37832 0.0
369.78893 1.0
47.17669 0.0
239.3073 0.0
17.37098 0.0
257.04444 0.0
198.63465 0.0
208.40444 0.0
338.28526 1.0
175.15057 0.0
234.97098 0.0
275.06893 0.0
186.46159 0.0
201.74322 0.0
237.58322 0.0
219.402 0.0
461.29587 1.0
196.67546 0.0
290.63791 0.0
328.22812 1.0
260.64934 0.0
245.83791 0.0
97.54077 0.0
248.0322 0.0
175.33342 0.0
199.57506 0.0
229.45914 0.0
902.26893 1.0
271.12444 0.0
211.17342 0.0
179.3824 0.0
156.96934 0.0
281.0771 0.0
291.97016 0.0
392.85506 1.0
223.00689 0.0
269.94893 0.0
36.64934 0.0
309.26322 0.0
178.41587 0.0
206.75873 0.0
155.68934 0.0
254.71955 0.0
133.11955 0.0
260.362 0.0
135.28771 0.0
158.27546 0.0
154.93179 0.0
205.84444 0.0
276.21832 0.0
193.61914 0.0
153.73016 0.0
389.11955 1.0
195.23873 0.0
210.72934 0.0
336.06485 1.0
263.02649 0.0
230.26893 0.0
40.6722 0.0
255.92118 0.0
305.60608 0.0
177.8673 0.0
361.11628 1.0
357.66812 1.0
196.49261 0.0
218.40934 0.0
91.58485 0.0
185.25995 0.0
282.80118 0.0
244.68853 0.0
215.40526 0.0
211.19955 0.0
327.75791 1.0
510.40608 1.0
212.74077 0.0
120.86812 0.0
507.08853 1.0
265.11628 0.0
183.06567 0.0
199.54893 0.0
41.92608 0.0
164.75383 0.0
267.33669 0.0
208.74404 0.0
253.09995 0.0
244.50567 0.0
195.73506 0.0
160.07791 0.0
327.70567 1.0
174.86322 0.0
272.92689 0.0
251.53261 0.0
216.99873 0.0
195.3171 0.0
247.11791 0.0
101.3024 0.0
315.97669 0.0
449.67138 1.0
173.16526 0.0
394.44853 1.0
226.69016 0.0
219.11465 0.0
240.92689 0.0
227.91791 0.0
119.84934 0.0
109.92281 0.0
116.08771 0.0
187.71546 0.0
191.65995 0.0
116.32281 0.0
482.45506 1.0
262.71302 0.0
208.97914 0.0
209.81506 0.0
129.85424 0.0
219.0624 0.0
500.4273 1.0
224.7571 0.0
274.85995 0.0
145.162 0.0
211.27791 0.0
167.49669 0.0
415.7122 1.0
346.33098 1.0
399.69914 1.0
136.56771 0.0

There are known techniques for dealing with skewed features. A simple technique is applying a power transformation. We are going to use the simplest and most common power transformation: logarithm.

In following cell we repeat the clustering experiment with a transformed DataFrame that includes a new column called log_duration.

val df = table("songsTable").selectExpr("tempo", "loudness", "log(duration) as log_duration")
val trainingData2 = new VectorAssembler().
                  setInputCols(Array("log_duration", "tempo", "loudness")).
                  setOutputCol("features").
                  transform(df)
val model2 = new KMeans().setK(2).fit(trainingData2)
val transformed2 = model2.transform(trainingData2).select("log_duration", "tempo", "loudness", "prediction")
display(transformed2.sample(false, fraction = 0.1))
log_duration tempo loudness prediction
4.892228263795702 89.519 0.596 1.0
5.321266069167063 99.722 -12.339 1.0
4.890069465059506 77.072 -19.018 1.0
5.128421707524712 149.709 -9.086 0.0
5.981520266236513 125.086 -8.858 1.0
3.9864630938537244 102.771 -8.348 1.0
5.4586834904217785 81.03 -4.351 1.0
4.901788411822545 104.155 -9.995 1.0
5.3676585240430414 121.879 -6.676 1.0
4.629902212435873 107.065 -5.793 1.0
5.695704905423108 133.245 -15.968 0.0
5.098409146993903 109.509 -11.688 1.0
5.274758113962512 160.093 -9.8 0.0
5.271409371809784 125.722 -11.383 1.0
5.220207760063188 178.457 -5.111 0.0
5.4080223065135975 115.051 -4.391 1.0
5.253812766217677 100.846 -17.772 1.0
5.450079581978073 123.436 -7.885 1.0
5.1587617503861605 104.546 -17.661 1.0
4.707590032112409 123.436 -7.661 1.0
5.532338501851636 79.327 -9.448 1.0
5.419427084876769 99.071 -6.437 1.0
5.574734540105573 131.984 -3.124 0.0
5.451425331508477 81.996 -5.243 1.0
5.30699570063741 117.089 -7.265 1.0
6.165752987143742 124.985 -9.327 1.0
5.315376921332985 172.282 -11.732 0.0
5.322669238165966 178.637 -5.65 0.0
5.367170955002224 153.471 -5.629 0.0
5.3359648235518415 152.604 -16.311 0.0
5.863407230069623 133.41 -11.714 0.0
5.177506777473437 105.835 -13.759 1.0
5.752687806796722 90.654 -7.9 1.0
5.343109071331969 155.839 -13.898 0.0
6.154220842182319 124.993 -9.335 1.0
4.394191590641474 81.892 -17.253 1.0
4.824718321534403 96.931 -25.969 1.0
5.4394747695975 115.32 -27.166 1.0
4.879205158949818 167.916 -10.475 0.0
5.57592266340285 66.84 -17.105 1.0
5.583414801700688 129.987 -5.065 1.0
5.212267799598076 126.594 -11.339 1.0
5.624684612142528 150.15 -2.945 0.0
5.049539098064766 106.711 -9.961 1.0
5.793629272482639 229.55 -11.221 0.0
5.234927305677438 101.512 -15.01 1.0
5.580858019525172 84.452 -15.906 1.0
5.571559292617606 131.909 -13.378 0.0
5.788602307521884 141.122 -8.686 0.0
4.970082221746526 152.041 -3.942 0.0
6.049039039652957 73.965 -6.694 1.0
5.030771068507152 122.206 -4.552 1.0
5.383496399152903 87.535 -8.193 1.0
5.59910335642404 202.202 -9.769 0.0
3.7580904018205405 144.656 -21.759 0.0
5.510499662196736 91.734 -7.787 1.0
5.415949635284104 88.669 -13.021 1.0
5.5224708477113715 147.009 -12.932 0.0
5.867703214491927 123.972 -8.218 1.0
5.93949099508187 135.225 -7.149 0.0
5.325088257046393 170.058 -7.167 0.0
5.414904042406895 115.039 -3.915 1.0
5.5960046693360805 133.809 -7.065 0.0
5.302843607646548 95.944 -14.027 1.0
5.535022226232155 109.03 -7.646 1.0
5.512083042725035 114.308 -5.128 1.0
4.949931260793479 76.955 -9.919 1.0
5.68280603270908 120.029 -8.123 1.0
5.5288181072501965 123.362 -12.138 1.0
5.755006848335441 96.66 -5.153 1.0
5.4583496443886625 95.173 -8.032 1.0
5.888403967900819 75.822 -20.6 1.0
5.497313542602982 148.228 -7.631 0.0
5.404387405434715 213.22 -6.547 0.0
5.40755403022849 130.008 -5.239 1.0
5.358476844907908 89.546 -5.737 1.0
5.762835163594046 135.286 -11.203 0.0
5.240616693947672 116.085 -15.192 1.0
4.689507198383877 196.218 -5.037 0.0
5.334958023447545 122.167 -14.249 1.0
5.1640040683149815 128.976 -10.014 1.0
5.933003732571149 96.627 -25.713 1.0
7.082153999499342 70.198 -20.06 1.0
6.083696607997674 96.715 -6.698 1.0
5.843086341116113 111.976 -7.519 1.0
5.3531743758536185 173.791 -8.575 0.0
5.749365533302135 126.926 -10.405 1.0
5.595810663643512 182.629 -4.415 0.0
5.1801562156651 202.819 -6.508 0.0
5.215536501039555 84.913 -9.411 1.0
6.242041322834571 106.155 -20.058 1.0
5.676114625435545 121.843 -5.426 1.0
5.141340989863751 122.12 -11.558 1.0
4.7325069942308415 112.172 -19.122 1.0
5.99936679196512 102.913 -5.725 1.0
5.871097297119184 164.057 -7.287 0.0
6.024005718051915 126.089 -7.56 1.0
4.050789844156208 92.502 -21.488 1.0
4.425627883486494 198.038 -4.413 0.0
5.823889504042276 127.869 -5.024 1.0
5.617021720803423 102.532 -21.859 1.0
5.056050499653188 204.32 -33.671 0.0
5.598232792959459 119.752 -6.199 1.0
4.891247596658531 137.639 -7.418 0.0
5.265893033592153 161.881 -11.354 0.0
4.517265864988051 174.526 -1.968 0.0
6.228685603732306 132.484 -10.758 0.0
5.423584151189881 99.976 -6.921 1.0
5.4844935264715495 125.023 -12.544 1.0
4.7543460260807855 66.166 -19.338 1.0
4.7563691709899825 194.894 -15.227 0.0
5.389356620738077 120.119 -6.989 1.0
6.215462333459528 140.038 -7.024 0.0
4.916820535591926 162.84 -21.235 0.0
5.67360501441859 167.627 -14.819 0.0
4.9297436261579115 131.889 -19.341 0.0
5.559460924718209 180.063 -8.458 0.0
5.6208132082285225 65.726 -18.979 1.0
5.717756350350775 99.095 -11.938 1.0
5.881794174009387 90.194 -11.13 1.0
5.750861938316315 142.684 -34.187 0.0
6.124023041620579 66.856 -18.342 1.0
4.959141137431965 110.091 -4.261 1.0
4.96097301974927 151.719 -12.37 0.0
5.312676824285775 131.021 -4.434 0.0
5.080219439635137 212.067 -6.545 0.0
5.395538310588208 122.881 -9.178 1.0
5.077128279024546 167.543 -27.615 0.0
5.360688133553469 191.044 -6.615 0.0
5.165496806936141 72.821 -22.331 1.0
5.330414836847097 117.99 -12.271 1.0
5.516713145004406 181.216 -10.646 0.0
5.291467207691819 141.057 -4.902 0.0
5.337849809954547 146.124 -9.33 0.0
5.639836453511393 94.363 -10.975 1.0
5.292518736943963 149.03 -7.679 0.0
5.3942338170785735 187.495 -9.851 0.0
5.480800285322447 106.475 -12.97 1.0
5.560968705190409 141.892 -6.395 0.0
4.587209351549678 100.152 -7.49 1.0
5.882449835222424 125.015 -6.138 1.0
5.12609700051445 95.002 -12.737 1.0
5.743273792218448 117.694 -13.517 1.0
5.680758751195347 127.045 -3.325 1.0
5.185287796501603 121.236 -7.65 1.0
5.667122570497586 109.965 -6.519 1.0
5.850632972880582 108.969 -8.918 1.0
5.168921752645453 114.372 -13.792 1.0
5.443888273735132 99.821 -6.999 1.0
5.667483810822177 168.042 -6.125 0.0
5.830661908645668 94.324 -4.089 1.0
5.641876503095035 143.837 -5.964 0.0
5.929118873255758 109.973 -13.02 1.0
5.858123107869744 127.977 -5.467 1.0
5.658048889386408 229.909 -5.407 0.0
6.1138473210629245 227.001 -16.889 0.0
5.221195796527836 127.304 -17.207 1.0
5.3080310357356755 106.987 -4.381 1.0
5.693683888480423 64.531 -8.135 1.0
5.024779393055371 126.968 -3.041 1.0
5.286457313335375 90.21 -5.072 1.0
5.628259435100028 125.06 -9.314 1.0
4.863794002154297 99.352 -11.506 1.0
5.105720054556155 128.73 -13.708 1.0
5.443210556309651 106.409 -13.678 1.0
5.586650576963475 187.973 -3.6 0.0
5.423584151189881 79.583 -11.749 1.0
5.50573446287648 90.984 -8.763 1.0
5.996381912027348 146.091 -10.571 0.0
5.378927989850037 96.081 -5.866 1.0
5.263055769740461 102.959 -5.813 1.0
4.994801464692383 77.26 -16.736 1.0
5.87741203189931 125.916 -4.355 1.0
5.021683965446997 66.09 -11.861 1.0
5.309194495513895 160.067 -3.026 0.0
5.312161690119503 137.979 -3.415 0.0
5.473482250340327 160.075 -5.482 0.0
6.172641657606361 199.772 -8.871 0.0
5.714574233587672 92.008 -6.051 1.0
5.395419802936953 171.865 -8.63 0.0
4.844858199794328 96.873 -19.552 1.0
5.060202299303682 104.551 -4.231 1.0
4.748930818586818 115.094 -17.793 1.0
5.314349167717073 149.229 -10.206 0.0
5.269932346654381 68.629 -15.055 1.0
5.9277973529214725 127.997 -4.827 1.0
5.43492773924482 129.895 -6.047 1.0
4.994270518609824 91.863 -14.203 1.0
5.095693709742171 105.907 -10.031 1.0
5.672617347966057 137.165 -7.992 0.0
5.5347129603785135 92.352 -10.665 1.0
5.327374538139593 127.007 -5.728 1.0
5.288833536866274 92.78 -8.946 1.0
5.484818758978618 133.085 -4.901 0.0
5.873672073907065 168.195 -3.712 0.0
5.944636977040216 173.331 -14.65 0.0
5.378566422161142 120.003 -7.086 1.0
5.103976627903757 135.011 -6.256 0.0
5.464009755293217 137.912 -9.125 0.0
5.081842591930373 70.493 -13.819 1.0
5.24199941706601 122.322 -16.949 1.0
5.3975509759903 127.839 -7.259 1.0
5.180009168017768 142.4 -11.379 0.0
5.514611191961615 174.931 -13.835 0.0
5.405444091539472 207.5 -14.066 0.0
5.312934267254636 119.386 -7.572 1.0
5.277695744967576 133.256 -8.598 0.0
5.434585866125362 99.652 -12.738 1.0
5.708526172177688 131.914 -7.071 0.0
5.991822533023377 105.729 -8.32 1.0
5.093932699490288 93.755 -11.965 1.0
4.676943535028833 133.688 -25.357 0.0
5.255177375047388 99.933 -17.731 1.0
5.473591859344723 127.986 -5.204 1.0
5.06845460431089 137.476 -20.349 0.0
6.269861975338076 125.036 -9.35 1.0
4.6061773785992814 107.049 -17.63 1.0
5.811613665680493 96.005 -8.276 1.0
5.37518557930167 144.646 -4.768 0.0
5.407202667843807 127.865 -6.744 1.0
5.10935559222606 89.513 -8.42 1.0
6.3119724941522355 80.637 -21.579 1.0
4.60068212971353 171.133 -7.373 0.0
5.302843607646548 146.46 -9.778 0.0
5.313963475320257 172.222 -5.742 0.0
5.945594651051933 91.964 -18.118 1.0
5.481561789037084 115.205 -14.74 1.0
5.240755041735268 119.842 -8.305 1.0
5.88121099672321 62.239 -11.823 1.0
5.417110114495573 169.442 -9.472 0.0
5.6501791457712125 117.221 -11.272 1.0
5.629667005038476 86.954 -5.186 1.0
5.153340899640642 106.959 -16.133 1.0
5.637140908112494 139.016 -3.58 0.0
4.536195814330017 89.495 -9.888 1.0
5.357123064536815 134.136 -4.418 0.0
4.956570935784844 124.498 -4.068 1.0
5.176622106863231 106.504 -17.826 1.0
6.215462333459528 140.004 -3.739 0.0
6.124080233101131 85.715 -11.73 1.0
5.496242551087362 186.035 -4.3 0.0
5.617970959362721 154.859 -8.951 0.0
4.89477353660241 180.719 -13.166 0.0
6.112748824037213 137.977 -6.56 0.0
6.09500688588351 158.965 -7.366 0.0
6.09459461717037 137.956 -5.248 0.0
5.4849271324832785 146.145 -11.286 0.0
5.786600466126096 103.014 -7.489 1.0
6.091644939062009 168.511 -1.296 0.0
5.459573173642483 105.409 -9.947 1.0
5.433445502449236 165.389 -14.098 0.0
5.265893033592153 116.564 -4.325 1.0
5.460239895734497 163.924 -9.666 0.0
5.6821833846868 109.337 -10.829 1.0
5.433559588618923 140.073 -2.28 0.0
5.139658682588309 95.939 -15.853 1.0
5.913426759488363 85.337 -10.002 1.0
5.651464515127707 80.394 -11.654 1.0
5.707051791278539 148.899 -9.717 0.0
5.268049377893244 89.584 -9.583 1.0
5.364485091062758 100.219 -4.528 1.0
5.174702584264729 161.441 -4.071 0.0
5.293700374625018 152.3 -5.655 0.0
5.377118888885022 89.335 -12.522 1.0
5.276762010119172 96.441 -15.351 1.0
5.335713194456806 74.808 -11.763 1.0
5.052215593031031 122.819 -5.179 1.0
5.574139929699739 104.013 -9.321 1.0
5.413740954228259 104.069 -6.998 1.0
5.837464901707784 154.916 -5.063 0.0
5.564477992630099 84.732 -13.35 1.0
6.413348475654663 135.016 -9.955 0.0
4.786017489938488 127.304 -14.125 1.0
5.323815800718434 88.023 -4.729 1.0
5.986914310465229 152.857 -17.676 0.0
5.589973519371366 115.341 -4.88 1.0
5.54853737950824 180.153 -4.271 0.0
5.732417387460131 152.865 -6.536 0.0
5.03008812165755 92.959 -11.161 1.0
5.133363062166066 148.873 -11.132 0.0
5.566777436858224 114.514 -9.754 1.0
5.237845445572235 87.652 -15.15 1.0
5.364485091062758 120.581 -10.633 1.0
5.281156456841302 136.499 -7.225 0.0
5.974304781873222 116.977 -5.82 1.0
5.712591031821589 96.74 -16.773 1.0
4.768201034433 163.559 -7.325 0.0
5.246961543889845 86.97 -3.22 1.0
5.848525642277589 135.013 -6.84 0.0
5.262785106679844 114.559 -16.931 1.0
5.715263119130469 89.991 -8.187 1.0
5.91891896148484 104.962 -8.96 1.0
5.752604892273739 98.979 -5.167 1.0
3.8280990755466293 120.914 -13.748 1.0
5.44422698189371 40.559 -16.461 1.0
5.775072248464427 141.395 -5.066 0.0
5.727072250071925 89.141 -7.753 1.0
5.099843744640108 243.768 -11.206 0.0
5.445467902438007 154.563 -7.677 0.0
5.863481448480461 150.891 -10.697 0.0
5.4541114095996726 88.904 -5.66 1.0
5.1318214806084255 129.198 -17.277 1.0
5.056549644534826 101.825 -12.092 1.0
5.568971940469297 90.02 -8.901 1.0
5.831275313524761 167.31 -6.281 0.0
5.435724974434051 122.089 -9.126 1.0
5.371307757297379 133.107 -21.615 0.0
5.0493715309354785 142.034 -5.804 0.0
5.0006231393320295 101.266 -11.025 1.0
5.138892996898216 143.89 -9.4 0.0
5.607958929769235 160.884 -10.113 0.0
5.114234780051099 101.722 -17.746 1.0
5.5619726050421585 82.061 -20.423 1.0
5.905558558950945 74.663 -16.268 1.0
5.559159087919424 160.04 -6.269 0.0
5.673425495622962 98.749 -9.197 1.0
5.5975552131122885 78.017 -10.212 1.0
4.068369957397399 85.893 -10.422 1.0
5.663049608108374 144.369 -16.004 0.0
5.745364212498396 106.679 -9.803 1.0
5.381695597481382 136.542 -8.01 0.0
5.6928919542966945 90.645 -9.302 1.0
5.8151253204408455 128.342 -10.902 1.0
5.611307435373474 92.365 -8.088 1.0
5.497741626441108 241.9 -7.06 0.0
5.483734294400877 100.05 -8.816 1.0
4.463356820883433 178.097 -20.59 0.0
6.009616032607714 120.021 -4.022 1.0
5.443323533906124 126.076 -4.774 1.0
4.51897582060811 99.609 -18.533 1.0
5.2034029884039 140.032 -13.016 0.0
5.327628225432808 105.253 -15.568 1.0
5.172927427877826 185.86 -24.732 0.0
5.241584779677972 98.853 -9.131 1.0
5.2885697626443715 127.053 -5.689 1.0
5.57404080623269 90.029 -5.921 1.0
5.988291041862788 146.713 -12.065 0.0
5.563576782171857 121.147 -7.329 1.0
4.800088568576119 86.994 -6.913 1.0
5.490007979677294 96.037 -6.355 1.0
5.705922882348458 45.29 -4.764 1.0
5.9032786988787525 130.906 -9.294 0.0
4.983234429165613 138.528 -13.315 0.0
5.32864242853564 142.029 -8.286 0.0
5.826203420044363 124.649 -6.772 1.0
5.346475426219603 87.048 -9.33 1.0
5.6017103980030365 86.005 -4.337 1.0
5.232977190837952 118.591 -22.645 1.0
4.914905953122828 132.841 -4.908 0.0
4.605394160903837 163.073 -7.354 0.0
5.490007979677294 90.417 -5.357 1.0
5.93050805616658 125.067 -7.343 1.0
4.602255241662874 86.067 -11.15 1.0
5.2573569249444265 111.942 -9.924 1.0
6.281461450769486 131.111 -14.636 0.0
5.206414390626549 51.149 -15.564 1.0
5.447270117662992 174.245 -13.962 0.0
5.0583776714334965 101.144 -19.823 1.0
5.123611357715729 159.947 -4.682 0.0
5.191411212562029 180.749 -10.095 0.0
5.52455636202782 85.036 -6.62 1.0
5.3465998780741435 130.047 -8.107 1.0
5.533165036662569 122.851 -8.173 1.0
5.352432281417797 133.252 -11.591 0.0
4.786453370526792 130.029 -9.234 1.0
5.322669238165966 106.696 -6.39 1.0
6.177370567861687 188.507 -5.994 0.0
5.747700248303512 123.554 -10.384 1.0
4.322313917258714 155.171 -22.438 0.0
5.768646067952092 100.014 -9.319 1.0
5.525285235827343 156.019 -5.927 0.0
5.755337701403143 131.966 -7.267 0.0
5.4158334776943535 109.389 -3.559 1.0
5.049706573007874 190.767 -6.435 0.0
5.0782682101517675 158.383 -12.358 0.0
6.0521169097161085 92.548 -7.185 1.0
5.270469694487864 167.866 -8.306 0.0
5.929744237745122 125.005 -11.71 1.0
5.094893657240654 62.415 -16.983 1.0
5.139199353255555 149.999 -11.615 0.0
5.192573332912147 140.193 -11.629 0.0
5.751692283172318 130.003 -7.796 1.0
5.823580575001653 114.618 -5.992 1.0
5.300891351005935 96.945 -7.784 1.0
5.5434394506679086 113.922 -5.388 1.0
4.544834553660172 100.041 -21.365 1.0
5.471507020818305 144.973 -10.508 0.0
5.5207992990407755 107.686 -8.702 1.0
4.946409115285852 108.942 -13.145 1.0
6.380080264819872 72.873 -13.246 1.0
5.393165257695243 92.993 -6.1 1.0
5.371429156963169 86.792 -7.699 1.0
5.964490624933571 115.305 -6.148 1.0
5.416646075519875 105.688 -6.344 1.0
5.711295514294399 93.226 -6.833 1.0
5.181037766646605 145.639 -14.832 0.0
5.336970611029115 191.115 -7.926 0.0
5.520380974933744 95.11 -8.842 1.0
5.046015307863599 109.808 -12.783 1.0
5.5221576350984165 145.29 -4.883 0.0
6.158927002222738 125.589 -8.6 1.0
5.829664300472271 105.233 -7.115 1.0
5.82928035569681 97.345 -11.499 1.0
5.3234337429963565 150.431 -14.729 0.0
5.843843560689231 79.998 -9.381 1.0
5.718185583433604 135.973 -9.091 0.0
5.183677878514388 151.075 -17.056 0.0
6.2489305655005545 123.994 -11.529 1.0
4.801162783465707 149.935 -14.465 0.0
5.679867340584397 140.047 -5.647 0.0
5.726391454576292 172.19 -10.391 0.0
4.950671183261074 64.334 -14.529 1.0
5.580069994537434 73.737 -11.521 1.0
5.633877937728569 88.543 -12.427 1.0
6.074302935529481 112.419 -9.126 1.0
5.515242262040878 98.573 -6.031 1.0
5.2981518028431225 88.983 -4.398 1.0
5.090079730533548 114.11 -16.08 1.0
4.577857260875427 126.393 -12.856 1.0
5.443210556309651 90.877 -20.028 1.0
5.7051405853395805 163.844 -7.44 0.0
5.226963621104301 91.977 -4.739 1.0
5.3436085115214835 116.677 -10.331 1.0
6.072136472167348 170.13 -5.743 0.0
5.312676824285775 70.164 -6.71 1.0
5.569071605770565 119.904 -15.7 1.0
4.879602263678485 57.169 -26.899 1.0
5.361424175775055 121.539 -4.295 1.0
5.539957987406313 175.214 -8.771 0.0
5.449069090750414 116.113 -10.064 1.0
6.39178918226169 119.462 -10.856 1.0
4.898092230774137 131.2 -23.689 1.0
5.146675187799474 180.176 -14.71 0.0
5.570465459051283 98.365 -5.838 1.0
4.637012398680066 117.831 -3.863 1.0
6.043164853654845 101.039 -8.928 1.0
5.6010351712128035 116.092 -5.004 1.0
5.784915818139458 128.608 -13.294 1.0
5.755420389655247 97.126 -9.347 1.0
6.071051466310348 140.007 -5.984 0.0
5.334832065977185 137.951 -3.854 0.0
5.575724721914124 111.492 -14.293 1.0
5.206843867263241 166.771 -13.425 0.0
5.232279802406715 163.892 -4.669 0.0
5.20182193961576 130.02 -4.823 1.0
5.726817030503055 80.231 -13.916 1.0
5.491085665616085 107.381 -14.135 1.0
5.5339908888778595 108.004 -9.795 1.0
6.766217520778982 89.822 -19.157 1.0
5.706965005029758 180.668 -12.834 0.0
5.441853698683162 127.398 -14.408 1.0
5.875873741134217 135.997 -6.62 0.0
5.1883541636466 101.284 -5.788 1.0
5.535228389797455 136.224 -2.943 0.0
3.7023283607776896 163.647 -17.534 0.0
4.715809006851246 136.747 -7.223 0.0
5.842252713576319 97.774 -12.557 1.0
5.119871270445839 122.053 -11.468 1.0
5.476547021251197 197.455 -10.545 0.0
7.29769003979548 160.031 -13.735 0.0
5.212267799598076 96.092 -15.221 1.0
5.027522892507361 120.527 -7.075 1.0
5.964087980307709 147.982 -3.273 0.0
5.194313929642153 177.327 -6.08 0.0
5.235205613758929 120.09 -11.84 1.0
5.3531743758536185 65.392 -16.533 1.0
5.454334902714114 83.76 -6.132 1.0
5.490977957518122 102.659 -4.713 1.0
5.38313652571645 147.487 -2.089 0.0
5.701307146892026 87.303 -6.336 1.0
5.648984132478454 163.031 -4.385 0.0
5.0889531304187505 93.12 -4.397 1.0
5.985535655916327 210.021 -8.131 0.0
5.167582972957962 120.007 -7.847 1.0
6.134096280733756 90.518 -9.769 1.0
4.684211007325698 110.907 -13.362 1.0
5.057048540395142 142.979 -16.184 0.0
4.874227540136429 173.551 -10.198 0.0
5.173519496873623 136.255 -9.675 0.0
6.1482649632811555 114.385 -6.821 1.0
6.575998134820792 97.952 -10.883 1.0
5.37106486725144 130.003 -5.82 1.0
5.1625090980936195 91.284 -10.212 1.0
5.287514121066575 131.953 -11.937 0.0
5.400975032797074 130.012 -8.769 1.0
5.5118720512729995 154.237 -7.34 0.0
5.339229916967983 98.959 -3.163 1.0
5.435497239117816 124.462 -12.121 1.0
5.334832065977185 92.483 -9.725 1.0
5.027180333628548 112.266 -4.523 1.0
5.831351955349967 106.887 -11.365 1.0
5.478839513708417 159.525 -9.96 0.0
3.867647830833469 104.033 -9.942 1.0
5.261701824986476 194.1 -4.3 0.0
5.206557551732531 99.772 -12.43 1.0
5.119715144445624 36.299 -22.109 1.0
5.20469469210529 119.894 -11.582 1.0
5.481453008551355 133.748 -12.546 0.0
4.99692236688031 121.083 -22.873 1.0
5.162060147947414 86.994 -7.803 1.0
5.731232031348783 110.043 -8.811 1.0
5.372521184108441 112.056 -13.859 1.0
5.566777436858224 92.446 -5.72 1.0
5.824275523795551 120.51 -11.445 1.0
5.599586650851792 102.846 -7.898 1.0
5.479275577741912 119.922 -8.373 1.0
5.083301136404237 78.461 -13.798 1.0
5.9151903650301545 76.072 -9.454 1.0
5.659779244812856 136.148 -8.394 0.0
5.865113031652334 86.034 -16.263 1.0
6.245339882354565 94.557 -7.916 1.0
5.771254033978842 125.757 -12.297 1.0
4.38901689577076 126.156 -7.754 1.0
5.695002409108728 66.264 -14.232 1.0
5.507219386966034 167.92 -5.221 0.0
5.245860974972483 186.697 -9.365 0.0
5.6208132082285225 158.8 -9.679 0.0
6.407851345829801 124.995 -6.92 1.0
5.604406865514699 220.697 -5.316 0.0
5.80376556785929 221.511 -13.778 0.0
5.314349167717073 118.004 -6.349 1.0
6.345254533555875 121.533 -11.372 1.0
5.301672731011365 132.67 -5.925 0.0
5.270738285863943 83.702 -23.316 1.0
5.466441490053851 163.937 -4.379 0.0
5.994365335749508 122.241 -11.11 1.0
5.142867977095725 122.183 -4.372 1.0
5.218935952671551 153.253 -22.082 0.0
5.240755041735268 195.997 -12.009 0.0
4.798367387974085 174.479 -28.719 0.0
5.183091795289894 184.937 -4.113 0.0
5.187624939257254 191.88 -10.798 0.0
6.188747496998347 129.979 -8.072 1.0
5.800608989092355 215.644 -15.482 0.0
5.2727501941416905 141.364 -11.059 0.0
3.464087670210369 148.661 -16.007 0.0
5.421623256463088 144.502 -9.495 0.0
5.129040713809273 124.967 -3.605 1.0
5.0006231393320295 84.205 -12.463 1.0
5.474796891858358 163.236 -12.258 0.0
5.1877708155139 86.154 -19.712 1.0
5.830661908645668 85.046 -9.732 1.0
5.489792278278364 169.914 -11.318 0.0
5.062189064556968 106.606 -16.264 1.0
5.3715505418928675 137.395 -6.876 0.0
4.955283318252515 103.193 -27.34 1.0
5.331931526930796 136.835 -12.374 0.0
6.976220349873523 89.058 -9.173 1.0
5.2625144221634805 99.305 -23.979 1.0
5.824352733505806 119.451 -11.391 1.0
5.226683009407633 217.213 -17.298 0.0
5.042816351013717 210.493 -10.655 0.0
5.495063101237499 123.999 -5.145 1.0
4.968630308451178 100.309 -4.012 1.0
5.495170411319036 134.757 -8.431 0.0
4.9477082027968295 100.576 -7.781 1.0
6.208758281558591 183.824 -7.48 0.0
5.521739878948984 169.369 -12.558 0.0
5.08475755662406 109.249 -5.537 1.0
5.509971324552225 111.036 -5.844 1.0
5.487741018652274 159.984 -9.817 0.0
4.585079513210795 106.927 -18.665 1.0
5.497206503249116 135.755 -7.424 0.0
5.534197225661299 86.821 -7.87 1.0
4.914139077895411 170.274 -9.547 0.0
5.241031679903366 84.583 -21.428 1.0
5.634811317219212 150.033 -5.412 0.0
5.582333904127796 165.465 -3.384 0.0
5.219642706004484 62.586 -20.636 1.0
5.56187226807967 94.05 -5.058 1.0
5.415601210962535 122.002 -8.926 1.0
5.321393698049809 147.628 -10.107 0.0
5.355274093383862 159.163 -16.636 0.0
5.583021872946544 138.174 -12.248 0.0
5.105561703300366 91.173 -15.527 1.0
6.218537428483649 130.097 -5.685 1.0
5.5424167623007925 156.889 -7.987 0.0
5.063676599821411 207.965 -5.222 0.0
5.774666756298699 103.84 -14.444 1.0
5.8748469071142 142.777 -5.118 0.0
4.812054590855806 109.219 -6.767 1.0
5.277162267073541 111.806 -8.802 1.0
5.20569822265645 160.686 -9.063 0.0
6.206548688450743 120.467 -11.189 1.0
5.624213299292985 73.536 -9.517 1.0
5.892738309215478 196.909 -22.759 0.0
5.40755403022849 120.04 -12.557 1.0
5.1477386330514046 189.559 -4.416 0.0
5.127802317834028 99.617 -8.164 1.0
5.573048916820139 145.024 -7.266 0.0
5.6244961280916925 86.97 -6.875 1.0
5.885358726001259 135.322 -9.147 0.0
5.771498193152581 77.546 -26.015 1.0
5.172927427877826 201.438 -23.14 0.0
5.4992384988300875 96.119 -15.96 1.0
5.139964745919678 84.774 -9.253 1.0
5.272884218579013 100.222 -4.278 1.0
5.423123107406227 195.391 -18.105 0.0
5.4624591684756965 125.754 -11.187 1.0
4.891247596658531 106.712 -6.241 1.0
4.971169740305285 95.764 -10.343 1.0
5.598329584361599 105.539 -11.365 1.0
5.752521970875367 150.74 -11.409 0.0
4.906051143655614 81.263 -13.755 1.0
5.540983231364382 88.327 -14.618 1.0
4.540942443220586 111.522 -22.854 1.0
5.840431489940934 122.877 -10.264 1.0
4.716977625501516 121.601 -11.847 1.0
5.6704590661683625 85.965 -8.232 1.0
5.295273739410578 171.934 -6.797 0.0
6.303021733454967 102.874 -9.574 1.0
5.632943722006943 120.018 -6.493 1.0
5.071408798946709 89.803 -4.474 1.0
5.055884083884031 115.957 -4.313 1.0
5.802504131779203 120.783 -6.07 1.0
5.372399916950057 148.113 -6.821 0.0
5.619961385101719 128.005 -5.02 1.0
5.597361508030061 117.384 -12.507 1.0
5.622514716915152 125.075 -9.747 1.0
5.620907802420415 175.036 -17.373 0.0
5.553002142155581 146.02 -2.758 0.0
4.973883477375123 115.076 -25.03 1.0
5.461128195938892 139.014 -13.208 0.0
5.209273999190886 137.968 -3.682 0.0
5.478948537110532 105.101 -9.257 1.0
5.912508457184818 120.006 -9.817 1.0
4.935767700169621 224.168 -4.118 0.0
5.8511591195715145 98.018 -7.316 1.0
5.217095977001863 203.536 -5.012 0.0
5.918075966130367 126.679 -7.866 1.0
5.743859551794383 132.226 -6.22 0.0
4.652329783410577 80.952 -9.428 1.0
4.846501257092688 152.828 -10.117 0.0
5.427150018610761 140.022 -8.666 0.0
5.938389745726143 126.896 -8.268 1.0
5.305570349956937 165.071 -6.987 0.0
5.0360481025678565 96.369 -10.233 1.0
5.976561064878677 130.082 -7.592 1.0
5.362527177416307 135.122 -8.42 0.0
5.102706841247405 122.77 -7.029 1.0
5.688657635429779 93.599 -7.747 1.0
5.514505988311902 163.746 -6.083 0.0
5.5721554009981205 110.946 -12.825 1.0
5.228785492682541 100.101 -5.655 1.0
5.976693642436394 107.667 -14.245 1.0
4.882971605159166 152.978 -10.637 0.0
5.629667005038476 81.091 -16.247 1.0
5.2261216034182745 116.854 -11.529 1.0
5.494633868982558 161.778 -6.88 0.0
5.812317007786956 146.907 -8.42 0.0
5.577405806789707 115.884 -5.74 1.0
5.345229959659761 156.364 -11.807 0.0
5.219218692301358 121.962 -8.005 1.0
5.197786170929668 99.705 -7.341 1.0
5.21992524590593 104.392 -12.048 1.0
3.6527962139408547 41.35 -23.844 1.0
5.495063101237499 143.899 -4.766 0.0
4.852026748288437 123.659 -8.514 1.0
5.670549079024892 142.517 -5.021 0.0
5.435383373805797 95.03 -12.839 1.0
5.820021029326741 124.992 -7.268 1.0
5.881429735039414 183.054 -17.493 0.0
5.345229959659761 73.95 -18.446 1.0
7.321494872253953 68.261 -23.546 1.0
6.022487398465634 141.698 -18.521 0.0
5.678707303899785 214.793 -6.437 0.0
5.474796891858358 175.59 -5.836 0.0
5.946004783492934 175.813 -12.149 0.0
5.720671547947515 133.604 -4.943 0.0
5.8116918591861175 140.085 -17.522 0.0
5.349334192721773 95.18 -10.21 1.0
5.207130046067124 102.432 -10.55 1.0
5.3080310357356755 111.98 -10.477 1.0
5.21070071550793 90.069 -9.896 1.0
5.461572050312247 111.282 -12.93 1.0
5.3699712477394845 188.077 -2.44 0.0
5.382896492177674 130.014 -8.025 1.0
5.054384966781395 81.619 -16.783 1.0
6.024005718051915 132.043 -8.854 0.0
5.478839513708417 120.12 -6.536 1.0
5.96375233636642 70.005 -8.163 1.0
5.153038845796511 131.943 -6.733 0.0
5.396012246148784 63.958 -9.75 1.0
5.716123542777973 130.017 -9.825 1.0
5.639929265305522 112.043 -8.633 1.0
5.503928356814888 148.041 -7.276 0.0
5.607000171810274 111.365 -10.116 1.0
5.422661850963155 131.378 -16.48 0.0
5.884414271275885 90.104 -12.29 1.0
5.530165601932363 124.072 -8.523 1.0
5.813332034006042 101.357 -14.142 1.0
5.754924125879842 142.785 -13.831 0.0
5.22218291169532 124.969 -6.707 1.0
6.120757401055048 130.004 -10.715 1.0
5.4360664584111635 154.461 -8.014 0.0
5.124544227693321 103.274 -5.609 1.0
6.140755810501547 127.983 -9.151 1.0
5.698947538500373 143.929 -7.615 0.0
5.462015707766298 104.959 -6.832 1.0
6.048298936235371 135.999 -5.845 0.0
5.210558146357011 115.936 -20.443 1.0
5.439814975694829 73.099 -19.293 1.0
5.515662740875034 99.389 -5.273 1.0
5.312419265723114 105.096 -9.143 1.0
5.520590138844219 104.019 -6.168 1.0
5.59590768975971 86.879 -7.154 1.0
5.29775986117079 119.383 -13.538 1.0
5.265488187950617 119.05 -14.293 1.0
5.032987413771107 149.967 -17.245 0.0
5.156657138568294 125.669 -9.773 1.0
5.459350805751235 107.244 -12.316 1.0
4.327844566531178 111.022 -11.143 1.0
6.003117709498463 94.353 -4.723 1.0
5.40026758875988 102.654 -4.451 1.0
5.465115810845681 200.007 -2.279 0.0
4.986986110278029 130.116 -18.077 1.0
5.831964937226711 107.301 -14.613 1.0
5.569868342129439 88.06 -5.256 1.0
6.167287911306899 132.329 -8.917 0.0
5.4739206562390805 102.869 -5.441 1.0
5.994104833482265 120.009 -16.17 1.0
5.302323381743563 95.79 -8.603 1.0
6.6315375194469555 116.65 -7.073 1.0
5.443888273735132 118.562 -5.283 1.0
5.02837867842324 180.874 -12.504 0.0
5.055551169240041 119.965 -14.589 1.0
7.093021778505688 113.487 -22.016 1.0
6.1961189425446355 134.995 -5.432 0.0
5.013729502093481 161.374 -3.537 0.0
5.168475672890415 100.162 -4.317 1.0
5.965161305025012 107.205 -13.267 1.0
5.603059559058559 116.989 -9.141 1.0
5.4125765563014685 71.879 -16.615 1.0
5.96971012630147 85.231 -11.807 1.0
5.328515721513685 130.042 -10.653 1.0
5.9024224095191435 131.37 -8.168 0.0
5.669288057615403 160.371 -4.355 0.0
6.150384215780737 101.745 -6.087 1.0
4.841770152276834 98.718 -12.394 1.0
5.500199568748536 127.232 -5.098 1.0
4.8930121206612265 130.275 -6.172 1.0
5.512715669405525 102.72 -8.132 1.0
5.440948103038991 129.765 -6.458 1.0
6.022550701770231 157.299 -14.304 0.0
5.870065544214879 145.781 -6.364 0.0
5.248472811704074 125.033 -7.126 1.0
5.27114096064532 114.179 -15.265 1.0
5.186164893232419 43.871 -19.915 1.0
5.278628659762669 147.463 -15.299 0.0
5.440834856737833 150.118 -4.63 0.0
5.496885316425803 92.33 -14.265 1.0
6.095065761101785 113.609 -10.615 1.0
6.338215331576072 137.947 -8.37 0.0
6.516728435671002 150.119 -7.031 0.0
5.39530128123997 157.772 -11.69 0.0
5.604214520046329 40.925 -29.594 1.0
5.4470449967586525 174.542 -4.122 0.0
5.033327924314677 160.027 -11.308 0.0
5.541495439837404 139.051 -5.808 0.0
5.955391985321944 60.029 -13.5 1.0
5.498811055436358 109.986 -6.547 1.0
5.0488688535069 110.305 -21.996 1.0
5.316660105195753 141.646 -17.401 0.0
5.179126709407211 95.161 -9.088 1.0
4.569770961636226 137.145 -7.001 0.0
5.363751299185053 96.92 -11.98 1.0
5.460239895734497 90.061 -9.326 1.0
5.455340089536665 89.41 -20.371 1.0
5.324961050170624 130.293 -12.07 1.0
6.362931616127083 112.493 -12.219 1.0
5.780732034244935 87.52 -6.887 1.0
5.321138423993106 61.559 -25.038 1.0
5.216670936098296 86.813 -12.724 1.0
4.9303098797983 115.033 -5.961 1.0
5.837617262918279 119.713 -8.219 1.0
5.656589464357225 129.915 -4.602 1.0
4.786453370526792 172.839 -11.03 0.0
4.919304054466615 88.034 -7.413 1.0
5.730808363040245 158.546 -4.839 0.0
5.422661850963155 99.944 -11.273 1.0
5.388879519564472 196.972 -1.682 0.0
5.6840501328899355 153.878 -4.352 0.0
5.814891615261906 110.284 -13.965 1.0
5.594160261221249 168.372 -9.951 0.0
5.495599413383852 131.243 -10.148 0.0
5.839063406776918 130.462 -7.743 1.0
5.207273104763058 171.76 -7.701 0.0
4.929932413000636 178.874 -4.06 0.0
5.545379728706228 87.931 -25.083 1.0
5.899061552343131 110.555 -6.531 1.0
3.9362407735904275 102.651 -19.475 1.0
5.013555891662754 107.696 -5.334 1.0
5.019787550797372 112.32 -11.828 1.0
5.7743422379268114 88.163 -22.409 1.0
5.348464989905088 118.972 -4.855 1.0
5.1760318725212615 156.503 -10.618 0.0
5.562875300086254 101.336 -16.5 1.0
5.789561773504737 131.846 -13.308 0.0
4.969719475730237 116.272 -9.544 1.0
5.593771532879778 96.243 -13.505 1.0
5.305959292509338 95.283 -13.174 1.0
6.022740611873921 90.211 -20.61 1.0
6.0135843161877975 230.273 -8.474 0.0
5.0251227095366655 88.039 -3.151 1.0
5.624401872742262 125.951 -7.896 1.0
5.090401409675572 105.555 -10.29 1.0
5.484276673697668 131.25 -6.723 0.0
5.283147534265708 97.011 -4.284 1.0
5.659961229933871 137.154 -12.948 0.0
5.397196125936762 100.055 -5.714 1.0
5.138892996898216 149.918 -13.349 0.0
6.271936167869813 105.471 -16.197 1.0
5.846640344336648 132.015 -9.453 0.0
5.780893288526451 120.074 -9.993 1.0
5.1242333478822175 123.788 -3.942 1.0
5.135517221042158 174.99 -13.746 0.0
5.636302886150193 132.04 -4.807 0.0
4.267456479061423 137.389 -4.395 0.0
5.810675135979183 146.426 -5.048 0.0
6.208495494465677 132.007 -8.931 0.0
5.568174489309459 157.041 -8.216 0.0
5.579675749052393 87.447 -7.733 1.0
5.1218988723462795 95.946 -17.03 1.0
6.35551712177877 146.064 -6.331 0.0
5.660870554706838 153.587 -8.91 0.0
6.283316662831049 114.273 -20.792 1.0
5.483842785490134 143.21 -7.974 0.0
5.1625090980936195 80.727 -14.976 1.0
5.029575588906314 120.884 -15.693 1.0
5.155151136154312 120.827 -7.96 1.0
5.34834076996525 91.963 -15.893 1.0
5.477639345770583 133.386 -7.999 0.0
3.9534303645890856 159.893 -22.096 0.0
4.96389701337343 103.823 -9.856 1.0
5.272884218579013 176.549 -13.379 0.0
5.967103768204722 140.024 -9.438 0.0
5.481670516067202 93.537 -5.165 1.0
5.383736288754334 200.374 -10.233 0.0
6.152054124101608 126.748 -5.715 1.0
5.863852486334342 104.587 -12.516 1.0
5.005536316376433 86.797 -13.678 1.0
5.538931730551451 120.05 -6.744 1.0
5.497420611473917 171.487 -6.941 0.0
5.099843744640108 96.857 -7.279 1.0
5.0111219756475744 157.013 -7.22 0.0
4.597001815500064 168.325 -10.217 0.0
5.299718184943652 130.94 -6.372 0.0
5.393284032812886 113.031 -7.892 1.0
5.086534784332229 128.029 -4.363 1.0
5.370214356996374 139.645 -8.873 0.0
5.992148887893402 128.004 -8.36 1.0
5.1254761688016615 140.422 -14.278 0.0
5.762260448974631 101.048 -17.318 1.0
4.886921078717307 156.884 -8.85 0.0
5.412343487161914 145.06 -14.511 0.0
5.647879766205785 75.073 -13.498 1.0
5.68856923797772 146.001 -4.621 0.0
5.654853575863566 140.284 -11.154 0.0
5.4053267071466236 198.06 -5.99 0.0
6.036257303707656 132.001 -9.288 0.0
4.763975558761478 100.021 -10.782 1.0
5.8521354947724085 125.933 -11.969 1.0
6.193987875385685 121.544 -11.663 1.0
4.84032586198911 85.65 -12.166 1.0
5.254768219224744 124.113 -11.111 1.0
6.55877942087373 131.016 -6.231 0.0
6.055369148610952 116.256 -13.986 1.0
5.0759869845220456 103.013 -6.912 1.0
4.781209802648447 122.948 -4.409 1.0
5.186310982615107 65.315 -4.905 1.0
6.508039466952436 155.996 -7.234 0.0
5.517867348720116 83.798 -16.654 1.0
5.335335656146118 116.121 -12.526 1.0
5.498917923186882 127.639 -10.966 1.0
5.10935559222606 108.97 -7.745 1.0
5.888548762879765 86.79 -9.088 1.0
5.075823853912898 89.38 -26.61 1.0
5.200958529678126 90.007 -7.236 1.0
5.83418384470021 125.9 -10.454 1.0
5.734868265796364 179.804 -11.507 0.0
5.1117194391010905 88.518 -11.4 1.0
5.6852039917893995 145.983 -4.189 0.0
5.557043752722271 171.928 -8.569 0.0
4.9477082027968295 129.658 -4.43 1.0
5.418385123573062 133.722 -18.631 0.0
5.758969878813607 110.136 -6.808 1.0
6.077244205426854 125.004 -13.744 1.0
4.962801482475908 116.049 -8.742 1.0
3.7352846336099574 92.736 -18.076 1.0
5.012165788957924 100.234 -17.07 1.0
5.742017477797979 153.876 -11.65 0.0
5.484385105962749 110.301 -12.249 1.0
5.588313409703403 86.415 -12.559 1.0
5.678439401395482 136.869 -6.221 0.0
5.457124616276923 105.985 -7.973 1.0
5.967772724185528 232.08 -5.493 0.0
5.795219831419931 120.349 -13.084 1.0
5.154849628686833 107.51 -10.176 1.0
5.655767554907144 113.624 -7.942 1.0
4.880197701210259 91.039 -12.242 1.0
5.6135017591989005 98.375 -7.397 1.0
5.561470781093142 155.746 -8.475 0.0
5.69086523855581 80.249 -6.368 1.0
5.460462066030494 110.33 -12.56 1.0
5.442758474965817 97.118 -6.476 1.0
6.2260032464103645 136.708 -9.193 0.0
4.235459501926911 163.762 -13.409 0.0
5.708959384637226 136.95 -16.247 0.0
5.297106183361719 63.211 -23.239 1.0
5.385772824085969 133.317 -10.874 0.0
5.413508200907366 121.09 -3.423 1.0
5.6077672663776985 75.419 -16.783 1.0
5.660779666389345 104.417 -10.339 1.0
5.940316136961045 64.287 -17.837 1.0
6.001244021781906 90.182 -9.47 1.0
5.400975032797074 129.749 -12.142 1.0
5.363628963785261 88.222 -6.461 1.0
5.459684317773558 150.979 -19.374 0.0
4.707354232003726 240.409 -9.958 0.0
5.40026758875988 88.922 -7.283 1.0
5.966969938663496 116.631 -19.261 1.0
5.457904357110395 133.973 -12.558 0.0
5.325088257046393 101.662 -10.225 1.0
5.457570250821884 167.909 -6.022 0.0
5.043153531656211 116.918 -6.256 1.0
5.090079730533548 130.771 -10.753 1.0
5.135824554356261 112.46 -9.011 1.0
5.552090486434681 77.483 -9.846 1.0
4.437127676630507 168.791 -12.926 0.0
5.73882765547205 173.908 -4.996 0.0
4.828904202943149 134.731 -12.021 0.0
5.344481896278029 130.863 -6.155 0.0
5.4750158098978945 85.092 -10.397 1.0
5.453328704474266 147.617 -15.986 0.0
4.916629256861545 121.926 -15.981 1.0
5.294749559486927 126.195 -9.953 1.0
5.823117017214163 117.966 -10.669 1.0
4.630666378060994 114.869 -7.877 1.0
5.825741076784775 112.582 -10.447 1.0
5.0921685826096885 125.02 -4.532 1.0
5.258580876404669 144.32 -16.982 0.0
5.016330313312448 97.034 -7.087 1.0
5.255859033956585 160.063 -9.434 0.0
6.4121485579856445 80.067 -14.007 1.0
5.77911821422353 143.499 -12.111 0.0
5.754096429647435 238.327 -7.028 0.0
5.268318568522543 96.792 -6.779 1.0
5.394589765089577 86.031 -9.499 1.0
5.369484805282204 107.956 -2.691 1.0
5.229765094411506 143.875 -12.669 0.0
4.886921078717307 107.077 -6.865 1.0
5.603252126785378 88.77 -15.305 1.0
5.939353392047761 125.872 -7.381 1.0
5.589973519371366 139.881 -11.774 0.0
5.832577543586846 108.428 -8.926 1.0
5.342109442007951 72.719 -6.972 1.0
5.138892996898216 68.997 -18.497 1.0
5.146523191314886 113.846 -10.347 1.0
5.2425519819921025 165.056 -3.491 0.0
5.473372587349946 148.009 -7.561 0.0
5.845507445551246 149.844 -12.284 0.0
5.0334981361160445 77.19 -10.41 1.0
5.559863219284914 191.634 -10.957 0.0
4.955099257607818 86.117 -10.34 1.0
5.777987004052884 200.035 -4.225 0.0
5.259803279675589 76.654 -6.583 1.0
5.221901009044842 146.079 -6.028 0.0
5.763573619815682 145.904 -5.366 0.0
6.0530384358750045 89.98 -5.539 1.0
5.569569630848934 191.269 -4.025 0.0
5.82628048105143 144.995 -7.894 0.0
5.452769272430743 144.119 -7.375 0.0
4.7352630988107265 114.697 -4.575 1.0
5.124699601624018 153.994 -3.267 0.0
5.501266373776714 135.997 -10.6 0.0
5.196340896321897 145.565 -9.9 0.0
5.050543591322241 75.314 -14.662 1.0
5.041972837064726 149.979 -12.687 0.0
5.5109221395078025 93.012 -4.912 1.0
6.018745027789532 130.405 -17.193 1.0
5.59774884361815 122.54 -7.804 1.0
6.053652299540131 89.921 -7.685 1.0
5.519962475758416 154.601 -10.035 0.0
5.262243612520556 112.61 -18.747 1.0
6.41949682365767 122.987 -13.159 1.0
5.48860523287039 205.482 -12.729 0.0
5.314606180567949 124.083 -5.768 1.0
5.816837670187332 85.129 -12.53 1.0
5.1786851597280235 116.436 -12.144 1.0
5.372828928676938 106.837 -24.014 1.0
5.422200381664391 95.014 -3.967 1.0
5.320499904706436 140.125 -6.84 0.0
5.232837762731037 100.021 -19.166 1.0
5.585769137482459 85.753 -15.435 1.0
5.426460857965772 71.021 -8.512 1.0
6.1902475551906875 125.993 -10.421 1.0
5.692275556616212 151.957 -6.651 0.0
5.39530128123997 177.287 -8.019 0.0
5.126717447034353 111.207 -6.467 1.0
5.7766116580794655 106.395 -12.657 1.0

The new clustering model makes much more sense. Songs with high tempo and loudness are put in one cluster and song duration does not affect song categories.

To really understand how the points in 3D behave you need to see them in 3D interactively and understand the limits of its three 2D projections. For this let us spend some time and play in sageMath Worksheet in CoCalc (it is free for light-weight use and perhaps worth the 7 USD a month if you need more serious computing in mathematics, statistics, etc. in multiple languages!).

Let us take a look at this sageMath Worksheet published here:

The point of the above little example is that you need to be able to tell a sensible story with your data science process and not just blindly apply a heuristic, but highly scalable, algorithm which depends on the notion of nearest neighborhoods defined by the metric (Euclidean distances in 3-dimensional real-valued spaces in this example) induced by the features you have engineered or have the power to re/re/...-engineer to increase the meaningfullness of the problem at hand.

Determining Optimal K

There are methods to find the optimal number of clusters. This partly depends on the purpose of the unsupervised learning task.

See here for some metrics in scala for the Irish dataset.