Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Apache Spark 2.x Machine Learning Cookbook

You're reading from  Apache Spark 2.x Machine Learning Cookbook

Product type Book
Published in Sep 2017
Publisher Packt
ISBN-13 9781783551606
Pages 666 pages
Edition 1st Edition
Languages
Authors (5):
Mohammed Guller Mohammed Guller
Profile icon Mohammed Guller
Siamak Amirghodsi Siamak Amirghodsi
Profile icon Siamak Amirghodsi
Shuen Mei Shuen Mei
Profile icon Shuen Mei
Meenakshi Rajendran Meenakshi Rajendran
Profile icon Meenakshi Rajendran
Broderick Hall Broderick Hall
Profile icon Broderick Hall
View More author details
Toc

Table of Contents (20) Chapters close

Title Page
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
1. Practical Machine Learning with Spark Using Scala 2. Just Enough Linear Algebra for Machine Learning with Spark 3. Spark's Three Data Musketeers for Machine Learning - Perfect Together 4. Common Recipes for Implementing a Robust Machine Learning System 5. Practical Machine Learning with Regression and Classification in Spark 2.0 - Part I 6. Practical Machine Learning with Regression and Classification in Spark 2.0 - Part II 7. Recommendation Engine that Scales with Spark 8. Unsupervised Clustering with Apache Spark 2.0 9. Optimization - Going Down the Hill with Gradient Descent 10. Building Machine Learning Systems with Decision Tree and Ensemble Models 11. Curse of High-Dimensionality in Big Data 12. Implementing Text Analytics with Spark 2.0 ML Library 13. Spark Streaming and Machine Learning Library

Downloading a complete dump of Wikipedia for a real-life Spark ML project


In this recipe, we will be downloading and exploring a dump of so we can have a real-life example. The dataset that we will be downloading in this recipe is a dump of Wikipedia articles. You will need the command-line tool curl, or a browser to retrieve a compressed file, which is about 13.6 GB at this time. Due to the size, we recommend the curl command-line tool.

How to do it...

  1. You can start with downloading the dataset using the following command:
curl -L -O http://dumps.wikimedia.org/enwiki/latest/enwiki-latest-pages-articles-multistream.xml.bz2
  1. Now you want to decompress the ZIP file:
bunzip2 enwiki-latest-pages-articles-multistream.xml.bz2

This should create an uncompressed file which is named enwiki-latest-pages-articles-multistream.xml and is about 56 GB.

  1. Let us take a look at the Wikipedia XML file:
head -n50 enwiki-latest-pages-articles-multistream.xml
<mediawiki xmlns=http://www.mediawiki.org/xml/export-0...
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}