Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Rapid - Apache Mahout Clustering designs

You're reading from  Rapid - Apache Mahout Clustering designs

Product type Book
Published in Oct 2015
Publisher
ISBN-13 9781783284436
Pages 130 pages
Edition 1st Edition
Languages

Using Mahout for streaming K-means


After understanding the algorithm side, let's see how we can use the Mahout implementation of Streaming K-means.

Dataset selection

To run the Streaming K-means, we will first select a dataset. The reference paper Fast and Accurate K-Means for Large Datasets, by M.Schindler, A.Wong, and A.Meyerson mentioned two datasets that they used—BigCross and Census1990.

Here, we will use the Census1990 dataset. This dataset can be downloaded from https://archive.ics.uci.edu/ml/machine-learning-databases/census1990-mld/.

This dataset has 2458285 number of instances and 68 number of attributes. Once you have download this data, you will notice that it is in the CSV format, and we cannot use this directly in Mahout.

Converting CSV to a vector file

You can use the following mentioned code to convert your CSV file to a Mahout readable vector.

This code is almost the same as that mentioned in Chapter 2, Understanding K-means Clustering:

public String getSeqFile(String inputLocation...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}