Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Learning Jupyter 5

You're reading from   Learning Jupyter 5 Explore interactive computing using Python, Java, JavaScript, R, Julia, and JupyterLab

Arrow left icon
Product type Paperback
Published in Aug 2018
Publisher
ISBN-13 9781789137408
Length 282 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (18) Chapters Close

Title Page
Packt Upsell
Contributors
Preface
1. Introduction to Jupyter FREE CHAPTER 2. Jupyter Python Scripting 3. Jupyter R Scripting 4. Jupyter Julia Scripting 5. Jupyter Java Coding 6. Jupyter JavaScript Coding 7. Jupyter Scala 8. Jupyter and Big Data 9. Interactive Widgets 10. Sharing and Converting Jupyter Notebooks 11. Multiuser Jupyter Notebooks 12. What's Next? 1. Other Books You May Enjoy Index

Java summary statistics


Java can produce summary statistics for a collection. We can retrieve the Iris dataset and put it into a collection before producing the statistics directly.

I have copied the file from http://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data to make the processing a little smoother.

We read in the Iris data and then call upon collections to produce a summary.

The code for this example is as follows:

import java.io.IOException; 
import java.nio.file.FileSystems; 
import java.nio.file.Files; 
import java.nio.file.Path; 
import java.text.DateFormat; 
import java.util.ArrayList; 
import java.util.List; 
import java.util.Map; 
import java.util.Optional; 
import java.util.regex.Pattern; 
import java.util.stream.Collectors; 
import java.util.stream.Stream; 
 
public class Iris { 
     
    public Iris(Double sepalLength, Double sepalWidth, Double 
     petalLength, Double petalWidth, String irisClass) { 
        this.sepalLength = sepalLength; 
        this.sepalWidth...
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
Visually different images