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
Java: Data Science Made Easy

You're reading from   Java: Data Science Made Easy Data collection, processing, analysis, and more

Arrow left icon
Product type Course
Published in Jul 2017
Publisher Packt
ISBN-13 9781788475655
Length 734 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (3):
Arrow left icon
Alexey Grigorev Alexey Grigorev
Author Profile Icon Alexey Grigorev
Alexey Grigorev
Richard M. Reese Richard M. Reese
Author Profile Icon Richard M. Reese
Richard M. Reese
Jennifer L. Reese Jennifer L. Reese
Author Profile Icon Jennifer L. Reese
Jennifer L. Reese
Arrow right icon
View More author details
Toc

Table of Contents (29) Chapters Close

Title Page
Credits
Preface
1. Module 1 FREE CHAPTER
2. Getting Started with Data Science 3. Data Acquisition 4. Data Cleaning 5. Data Visualization 6. Statistical Data Analysis Techniques 7. Machine Learning 8. Neural Networks 9. Deep Learning 10. Text Analysis 11. Visual and Audio Analysis 12. Visual and Audio Analysis 13. Mathematical and Parallel Techniques for Data Analysis 14. Bringing It All Together 15. Module 2
16. Data Science Using Java 17. Data Processing Toolbox 18. Exploratory Data Analysis 19. Supervised Learning - Classification and Regression 20. Unsupervised Learning - Clustering and Dimensionality Reduction 21. Working with Text - Natural Language Processing and Information Retrieval 22. Extreme Gradient Boosting 23. Deep Learning with DeepLearning4J 24. Scaling Data Science 25. Deploying Data Science Models 26. Bibliography

Creating histograms


Histograms, though similar in appearance to bar charts, are used to display the frequency of data items in relation to other items within the dataset. Each of the following examples using GRAL will use the DataTable class to initially hold the data to be displayed. In this example, we will read data from a sample file called AgeofMarriage.csv. This comma-separated file holds a list of ages at which people were first married.

We will create a new class, called HistogramExample, which extends the JFrame class and contains the following code within its constructor. We first create a DataReader object to specify that the data is in CSV format. We then use a try-catch block to handle IO exceptions and call the DataReader class's read method to place the data directly into a DataTable object. The first parameter of the read method is a FileInputStream object, and the second specifies the type of data expected from within the file:

DataReader readType=
  DataReaderFactory.getInstance...
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