Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Big Data Analytics with Java
Big Data Analytics with Java

Big Data Analytics with Java: Data analysis, visualization & machine learning techniques

Arrow left icon
Profile Icon RAJAT MEHTA
Arrow right icon
Can$38.99 Can$55.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3 (3 Ratings)
eBook Jul 2017 418 pages 1st Edition
eBook
Can$38.99 Can$55.99
Paperback
Can$69.99
Subscription
Free Trial
Arrow left icon
Profile Icon RAJAT MEHTA
Arrow right icon
Can$38.99 Can$55.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3 (3 Ratings)
eBook Jul 2017 418 pages 1st Edition
eBook
Can$38.99 Can$55.99
Paperback
Can$69.99
Subscription
Free Trial
eBook
Can$38.99 Can$55.99
Paperback
Can$69.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Big Data Analytics with Java

Chapter 2. First Steps in Data Analysis

Let's take the first steps towards data analysis now. Spark has a very useful module, Spark. Apache Spark has a prebuilt module called as Spark SQL and this module is used for structured data processing. Using this module, we can execute SQL queries on our underlying data. Spark lets you read data from various datasources whether text, CSV, or Parquet files on HDFS or also from hive tables or HBase tables. For simple data analysis tasks, whether you are exploring your datasets initially or trying to analyze and cut a report for your end users with simple stats this module is tremendously useful.

In this chapter, we will work on two datasets. The first dataset that we will analyze is a simple dataset and the next one is a more complex real-world dataset from an e-commerce store.

In this chapter, we will cover the following topics:

  • Basic statistical analytic approaches using Spark SQL
  • Building association rules using the Apriori algorithm...

Datasets

Before we get our hands wet in the world of complex analytics, we will take small baby steps and learn some basic statistical analysis first. This would help us get familiar with the approach that we will be using on big data for other solutions as well. For our analysis initially we will take a simple cars JSON dataset that has details about a few cars from different countries. We will analyze it using Spark SQL and see how easy it is to query and analyze datasets using Spark SQL. Spark SQL is handy to use for basic analytics purposes and is nicely suited on big data. It can be run on massive datasets and data can reside in HDFS.

To start with a simple case study we are using a cars dataset. This dataset can be obtained from http://www.carqueryapi.com/. It can be obtained from link http://www.carqueryapi.com/api/0.3/?callback=?&cmd=getMakes. This datasets contains data about cars in different countries. It is in JSON format. It is not a very big dataset from the perspective...

Data cleaning and munging

The major amount of time spent by a developer while performing a data analysis task is spent in data cleaning or producing data in a particular format. Most of the time, while performing analysis of some log file data or getting files from some other system, there will definitely be some data cleaning involved. Data cleaning can be in many forms whether it involves discarding a certain kind of data or converting some bad data into a different format. Also note that most of the machine learning algorithms involve running algorithms on a mathematical dataset, but most of the practical datasets won't always have mathematical data. Converting text data to mathematical form is another important task that many developers need to do themselves before they can apply the data analysis tasks on the data.

If there are problems in the data that we need to resolve before we use it, then this approach of fixing the data is called as data munging. One of the common data munging...

Basic analysis of data with Spark SQL

Spark SQL is a spark module for structured data processing. Almost all the developers know SQL. Spark SQL provides an SQL interface to your Spark data (RDDs). Using Spark SQL you can fire SQL queries or SQL-like queries on your big data set and fetch data in objects called dataframes.

A dataframe is like a relational database table. It has columns in it and we can apply functions to these columns such as groupBy, and so on. It is very easy to learn and use.

In the next section, we will cover a few examples on how we can use the dataframe and run regular analysis tasks.

Building SparkConf and context

This is just boilerplate code and is the entry point for the usage of our Spark SQL code. Every spark program will start with this boiler plate code for initialization. In this code we build the Spark configuration and then apply the configuration parameters (like application name and master location) and also build the SparkSession object. This SparkSession...

Implementation of the Apriori algorithm in Apache Spark

We have gone through the preceding algorithm. Now we will try to write the entire algorithm in Spark. Spark does not have a default implementation of Apriori algorithm, so we will have to write our own implementation as shown next (refer to the comments in the code as well).

First, we will have the regular boilerplate code to initiate the Spark configuration and context:

SparkConf conf = new SparkConf().setAppName(appName).setMaster(master);
JavaSparkContext sc = new JavaSparkContext(conf);

Now, we will load the dataset file using the SparkContext and store the result in a JavaRDD instance. We will create the instance of the AprioriUtil class. This class contains the methods for calculating the support and confidence values. Finally, we will store the total number of transactions (stored in the transactionCount variable) so that this variable can be broadcasted and reused on different DataNodes when needed:

JavaRDD<String> rddX ...

Summary

We started this chapter on a simple note by going over the very basic yet very power simple analytics on simple datasets. While doing so, we also learned a very powerful module of Apache Spark called Spark SQL. Using this module, Java developers can use their regular SQL skills and analyze their big data datasets.

After exploring the simple analytics piece using spark-sql, we went over two complex analytic algorithms: Apriori and FP-Growth. We learned how we can use these algorithms to build association rules from a transaction dataset.

In the next chapter, we will learn the basics of machine learning and get an introduction to the machine learning approach for dealing with a predictive analytics problem.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • • Acquire real-world set of tools for building enterprise level data science applications
  • • Surpasses the barrier of other languages in data science and learn create useful object-oriented codes
  • • Extensive use of Java compliant big data tools like apache spark, Hadoop, etc.

Description

This book covers case studies such as sentiment analysis on a tweet dataset, recommendations on a movielens dataset, customer segmentation on an ecommerce dataset, and graph analysis on actual flights dataset. This book is an end-to-end guide to implement analytics on big data with Java. Java is the de facto language for major big data environments, including Hadoop. This book will teach you how to perform analytics on big data with production-friendly Java. This book basically divided into two sections. The first part is an introduction that will help the readers get acquainted with big data environments, whereas the second part will contain a hardcore discussion on all the concepts in analytics on big data. It will take you from data analysis and data visualization to the core concepts and advantages of machine learning, real-life usage of regression and classification using Naïve Bayes, a deep discussion on the concepts of clustering,and a review of simple neural networks on big data using deepLearning4j or plain Java Spark code. This book is a must-have book for Java developers who want to start learning big data analytics and want to use it in the real world.

Who is this book for?

This book is for Java developers who are looking to perform data analysis in production environment. Those who wish to implement data analysis in their Big data applications will find this book helpful.

What you will learn

  • • Start from simple analytic tasks on big data
  • • Get into more complex tasks with predictive analytics on big data using
  • machine learning
  • • Learn real time analytic tasks
  • • Understand the concepts with examples and case studies
  • • Prepare and refine data for analysis
  • • Create charts in order to understand the data
  • • See various real-world datasets

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jul 31, 2017
Length: 418 pages
Edition : 1st
Language : English
ISBN-13 : 9781787282193
Vendor :
Apache
Category :
Languages :
Concepts :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jul 31, 2017
Length: 418 pages
Edition : 1st
Language : English
ISBN-13 : 9781787282193
Vendor :
Apache
Category :
Languages :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Can$6 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Can$6 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total Can$ 217.97
Java Data Analysis
Can$69.99
Big Data Analytics with Java
Can$69.99
Mastering Java Machine Learning
Can$77.99
Total Can$ 217.97 Stars icon
Banner background image

Table of Contents

14 Chapters
1. Big Data Analytics with Java Chevron down icon Chevron up icon
2. First Steps in Data Analysis Chevron down icon Chevron up icon
3. Data Visualization Chevron down icon Chevron up icon
4. Basics of Machine Learning Chevron down icon Chevron up icon
5. Regression on Big Data Chevron down icon Chevron up icon
6. Naive Bayes and Sentiment Analysis Chevron down icon Chevron up icon
7. Decision Trees Chevron down icon Chevron up icon
8. Ensembling on Big Data Chevron down icon Chevron up icon
9. Recommendation Systems Chevron down icon Chevron up icon
10. Clustering and Customer Segmentation on Big Data Chevron down icon Chevron up icon
11. Massive Graphs on Big Data Chevron down icon Chevron up icon
12. Real-Time Analytics on Big Data Chevron down icon Chevron up icon
13. Deep Learning Using Big Data Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3
(3 Ratings)
5 star 33.3%
4 star 66.7%
3 star 0%
2 star 0%
1 star 0%
Pach P Aug 25, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The best part about this book is that it covered the applicability of Big Data Analytics from multiple perspectives in very simple, easy to understand format. This allowed me to 'build a big picture view through hands on approach' on how to effectively leverage different Machine Learning concepts & APIs in Big Data Analytics.Each of the subjects was covered with clear and concise case studies and examples which I could readily take from github and tinker around. This was specially helpful and relevant to me as a relative newbie in this field who has tried making sense of it all by walking through the maze of blogs, api docs and videos.Were it basics on Big Data, Visualization, Regression, Sentiment Analytics or invaluable coverage on more advanced subjects like Graph Analytics, Recommendation Engines, Real Time Analytics and Deep Learning - easy readability and relatable examples helped me flow through the subjects and progressively build a deeper understanding of how these different ideas connect together.Hats off to the author for having taken the pains of cutting through the clutter and delivering the powerful concepts in elegantly simple examples. His efforts resulted in this deceptively simple yet comprehensive masterpiece which I could read and follow along from start to finish in about 6 weeks. Wish I had come across this book 2 years ago..
Amazon Verified review Amazon
Vladimir Alarcon Jan 09, 2020
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
**The Bad**80% of the code examples, JSON examples, and other don't pass the most basic syntax. Seriously. I don't know if the examples are intentionally badly written but they won't compile, not even close. The author talks about getting the code from some web site; maybe they work there, but don't expect to understand the example just by reading the book.The English writing skills are decent, though sometimes simple, if you know what I mean. I don't think it's OK to say "this is bad". The authors should phrase it better by saying something like "this won't work well in this scenario, or won't scale well in the future, and/or won't show the correct result all the time". Some personal opinions are phrased as facts without no further explanation... and some readers may think they are facts. Did I mention there are many misspellings?**The Good**The content. The book covers a fairly amount of content and buzzwords you have heard, and it explains it well, albeit sometimes in a too "simple" (read confusing) manner. It's fairly complete.A decent developer will be able to try each example 5 or 10 times to finally make it work, changing the syntax, guessing where to get the missing libraries, removing/adding some lines, figuring out imports, you-name-it. I found that this actually adds to the experience, so I ended up learning a lot with all that hands-on experimentation. However, an entry-level developer may not agree on this one.**Bottom Line**The book covers a lot of content you probably want to learn. It does explains those buzzwords pretty well. Finally, if you are a hands-on Java developer, you can squeeze knowledge from this book.
Amazon Verified review Amazon
alf_biker Nov 12, 2017
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
The book is good and covers a lot of stuff, but the code examples don't work. I think with a little more work it can be excellent.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.