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
Java Data Analysis
Java Data Analysis

Java Data Analysis: Data mining, big data analysis, NoSQL, and data visualization

Arrow left icon
Profile Icon John R. Hubbard
Arrow right icon
$19.99 per month
Paperback Sep 2017 412 pages 1st Edition
eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon John R. Hubbard
Arrow right icon
$19.99 per month
Paperback Sep 2017 412 pages 1st Edition
eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Java Data Analysis

Chapter 2. Data Preprocessing

Before data can be analyzed, it is usually processed into some standardized form. This chapter describes those processes.

Data types

Data is categorized into types. A data type identifies not only the form of the data but also what kind of operations can be performed upon it. For example, arithmetic operations can be performed on numerical data, but not on text data.

A data type can also determine how much computer storage space an item requires. For example, a decimal value like 3.14 would normally be stored in a 32-bit (four bytes) slot, while a web address such as https://google.com might occupy 160 bits.

Here is a categorization of the main data types that we will be working with in this book. The corresponding Java types are shown in parentheses:

  • Numeric types
    • Integer (int)
    • Decimal (double)
  • Text type
    • String (String)
  • Object types
    • Date (java.util.Date)
    • File (java.io.File)
    • General object (Object)

Variables

In computer science, we think of a variable as a storage location that holds a data value. In Java, a variable is introduced by declaring it to have a specific type. For example, consider the following statement:

String lastName;

It declares the variable lastName to have type String.

We can also initialize a variable with an explicit value when it is declared, like this:

double temperature = 98.6;

Here, we would think of a storage location named temperature that contains the value 98.6 and has type double.

Structured variables can also be declared and initialized in the same statement:

int[] a = {88, 11, 44, 77, 22};

This declares the variable a to have type int[] (array of ints) and contain the five elements specified.

Data points and datasets

In data analysis, it is convenient to think of the data as points of information. For example, in a collection of biographical data, each data point would contain information about one person. Consider the following data point:

("Adams", "John", "M", 26, 704601929)

It could represent a 26-year-old male named John Adams with ID number 704601929.

We call the individual data values in a data point fields (or attributes). Each of these values has its own type. The preceding example has five fields: three text and two numeric.

The sequence of data types for the fields of a data point is called its type signature. The type signature for the preceding example is (text, text, text, numeric, numeric). In Java, that type signature would be (String, String, String, int, int).

A dataset is a set of data points, all of which have the same type signature. For example, we could have a dataset that represents a group of people, each point representing a...

Relational database tables

In a relational database, we think of each dataset as a table, with each data point being a row in the table. The dataset's signature defines the columns of the table.

Here is an example of a relational database table. It has four rows and five columns, representing a dataset of four data points with five fields:

Last name

First name

Sex

Age

ID

Adams

John

M

26

704601929

White

null

F

39

440163867

Jones

Paul

M

49

602588410

Adams

null

F

30

120096334

Note

There are two null fields in this table.

Because a database table is really a set of rows, the order of the rows is irrelevant, just as the order of the data points in any dataset is irrelevant. For the same reason, a database table may not contain duplicate rows and a dataset may not contain duplicate data points.

Key fields

A dataset may specify that all values of a designated field be unique. Such a field is called a key field for the dataset. In the preceding example, the ID number field...

Hash tables

A dataset of key-value pairs is usually implemented as a hash table. It is a data structure in which the key acts like an index into the set, much like page numbers in a book or line numbers in a table. This direct access is much faster than sequential access, which is like searching through a book page-by-page for a certain word or phrase.

In Java, we usually use the java.util.HashMap<Key,Value> class to implement a key-value pair dataset. The type parameters Key and Value are specified classes. (There is also an older HashTable class, but it is considered obsolete.)

Here is a data file of seven South American countries:

Hash tables

Figure 2-1 Countries data file

Here is a Java program that loads this data into a HashMap object:

Hash tables

Listing 2-1 HashMap example for Countries data

The Countries.dat file is in the data folder. Line 15 instantiates a java.io.File object named dataFile to represent the file. Line 16 instantiates a java.util.HashMap object named dataset. It is structured to have...

Data types


Data is categorized into types. A data type identifies not only the form of the data but also what kind of operations can be performed upon it. For example, arithmetic operations can be performed on numerical data, but not on text data.

A data type can also determine how much computer storage space an item requires. For example, a decimal value like 3.14 would normally be stored in a 32-bit (four bytes) slot, while a web address such as https://google.com might occupy 160 bits.

Here is a categorization of the main data types that we will be working with in this book. The corresponding Java types are shown in parentheses:

  • Numeric types

    • Integer (int)

    • Decimal (double)

  • Text type

    • String (String)

  • Object types

    • Date (java.util.Date)

    • File (java.io.File)

    • General object (Object)

Variables


In computer science, we think of a variable as a storage location that holds a data value. In Java, a variable is introduced by declaring it to have a specific type. For example, consider the following statement:

String lastName;

It declares the variable lastName to have type String.

We can also initialize a variable with an explicit value when it is declared, like this:

double temperature = 98.6;

Here, we would think of a storage location named temperature that contains the value 98.6 and has type double.

Structured variables can also be declared and initialized in the same statement:

int[] a = {88, 11, 44, 77, 22};

This declares the variable a to have type int[] (array of ints) and contain the five elements specified.

Data points and datasets


In data analysis, it is convenient to think of the data as points of information. For example, in a collection of biographical data, each data point would contain information about one person. Consider the following data point:

("Adams", "John", "M", 26, 704601929)

It could represent a 26-year-old male named John Adams with ID number 704601929.

We call the individual data values in a data point fields (or attributes). Each of these values has its own type. The preceding example has five fields: three text and two numeric.

The sequence of data types for the fields of a data point is called its type signature. The type signature for the preceding example is (text, text, text, numeric, numeric). In Java, that type signature would be (String, String, String, int, int).

A dataset is a set of data points, all of which have the same type signature. For example, we could have a dataset that represents a group of people, each point representing a unique member of the group. Since...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Get your basics right for data analysis with Java and make sense of your data through effective visualizations.
  • Use various Java APIs and tools such as Rapidminer and WEKA for effective data analysis and machine learning.
  • This is your companion to understanding and implementing a solid data analysis solution using Java

Description

Data analysis is a process of inspecting, cleansing, transforming, and modeling data with the aim of discovering useful information. Java is one of the most popular languages to perform your data analysis tasks. This book will help you learn the tools and techniques in Java to conduct data analysis without any hassle. After getting a quick overview of what data science is and the steps involved in the process, you’ll learn the statistical data analysis techniques and implement them using the popular Java APIs and libraries. Through practical examples, you will also learn the machine learning concepts such as classification and regression. In the process, you’ll familiarize yourself with tools such as Rapidminer and WEKA and see how these Java-based tools can be used effectively for analysis. You will also learn how to analyze text and other types of multimedia. Learn to work with relational, NoSQL, and time-series data. This book will also show you how you can utilize different Java-based libraries to create insightful and easy to understand plots and graphs. By the end of this book, you will have a solid understanding of the various data analysis techniques, and how to implement them using Java.

Who is this book for?

If you are a student or Java developer or a budding data scientist who wishes to learn the fundamentals of data analysis and learn to perform data analysis with Java, this book is for you. Some familiarity with elementary statistics and relational databases will be helpful but is not mandatory, to get the most out of this book. A firm understanding of Java is required.

What you will learn

  • Develop Java programs that analyze data sets of nearly any size, including text
  • Implement important machine learning algorithms such as regression, classification, and clustering
  • Interface with and apply standard open source Java libraries and APIs to analyze and visualize data
  • Process data from both relational and non-relational databases and from time-series data
  • Employ Java tools to visualize data in various forms
  • Understand multimedia data analysis algorithms and implement them in Java.

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 19, 2017
Length: 412 pages
Edition : 1st
Language : English
ISBN-13 : 9781787285651
Category :
Languages :
Concepts :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Sep 19, 2017
Length: 412 pages
Edition : 1st
Language : English
ISBN-13 : 9781787285651
Category :
Languages :
Concepts :
Tools :

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 $5 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 $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 204.97
Machine Learning: End-to-End guide for Java developers
$94.99
Java Data Analysis
$54.99
Big Data Analytics with Java
$54.99
Total $ 204.97 Stars icon
Banner background image

Table of Contents

13 Chapters
1. Introduction to Data Analysis Chevron down icon Chevron up icon
2. Data Preprocessing Chevron down icon Chevron up icon
3. Data Visualization Chevron down icon Chevron up icon
4. Statistics Chevron down icon Chevron up icon
5. Relational Databases Chevron down icon Chevron up icon
6. Regression Analysis Chevron down icon Chevron up icon
7. Classification Analysis Chevron down icon Chevron up icon
8. Cluster Analysis Chevron down icon Chevron up icon
9. Recommender Systems Chevron down icon Chevron up icon
10. NoSQL Databases Chevron down icon Chevron up icon
11. Big Data Analysis with Java Chevron down icon Chevron up icon
A. Java Tools Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.