Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Big Data Analytics with Java

You're reading from   Big Data Analytics with Java Data analysis, visualization & machine learning techniques

Arrow left icon
Product type Paperback
Published in Jul 2017
Publisher Packt
ISBN-13 9781787288980
Length 418 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
RAJAT MEHTA RAJAT MEHTA
Author Profile Icon RAJAT MEHTA
RAJAT MEHTA
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

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

Data exploration

In this section, we will explore this dataset and try to perform some simple and useful analytics on top of this dataset.

First, we will create the boilerplate code for Spark configuration and the Spark session:

SparkConf conf = ...
SparkSession session = ...

Next, we will load the dataset and find the number of rows in it:

Dataset<Row> rawData = session.read().csv("data/retail/Online_Retail.csv");

This will print the number of rows in the dataset as:

Number of rows --> 541909

As you can see, this is not a very small dataset but it is not big data either. Big data can run into terabytes. We have seen the number of rows, so let's look at the first few rows now.

rawData.show();

This will print the result as:

Data exploration

As you can see, this dataset is a list of transactions including the country name from where the transaction was made. But if you look at the columns of the tables, Spark has given a default name to the dataset columns. In order to provide a schema and better...

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 $19.99/month. Cancel anytime