O'Reilly logo

Apache Mahout Essentials by Jayani Withanawasam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

A visualization example for K-Means clustering

In this example, we demonstrate the visualization of clusters in K-Means clustering. We use the same example as that given in Chapter 2, Clustering, K-Means clustering section (Clustering people based on height and weight).

Follow the given step-by-step guide to come up with a visualization for the previous example using D3.js:

  1. Download the D3.js JavaScript file from https://github.com/mbostock/d3/releases.
  2. You can directly use the web reference as well from http://d3js.org/d3.v3.min.js.
  3. Create a basic HTML file named kmeans.html using any text editor, as follows:

    Note

    Save kmeans.html in the same directory as the one in which d3.v3.min.js resides, or give the path accordingly if you are referencing D3.js ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required