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
Explore 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
Mastering Clojure Data Analysis
Mastering Clojure Data Analysis

Mastering Clojure Data Analysis: If you'd like to apply your Clojure skills to performing data analysis, this is the book for you. The example based approach aids fast learning and covers basic to advanced topics. Get deeper into your data.

eBook
€8.99 €39.99
Paperback
€48.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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

Shipping Address

Billing Address

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

Mastering Clojure Data Analysis

Chapter 2. GIS Analysis – Mapping Climate Change

One area of data analysis that's gotten a lot of attention is Geographic Information Systems (GIS). GIS is a system that is designed to store, manage, manipulate, and analyze geographic data. As such, GIS sits at the intersection of cartography, computers, statistics, and information science.

GIS is applied to fields as diverse as military planning, epidemiology, architecture, urban planning, archaeology, and many other fields. Basically, any domain or problem that involves location or topology can use GIS techniques or methods.

As you can imagine from this very brief description, we won't even scratch the surface of GIS in this chapter. However, we'll apply it to a small problem to see how it can help us understand the way climate change affects the continental United States in a better manner.

Understanding GIS


While the preceding description is accurate, it doesn't really help us much. As befits a field concerned with the lay of the land, GIS really begins in the field. Data is gathered using aerial and satellite photography, and it is also gathered from people on the ground using GPS, laser range finders, and surveying tools. GIS can also make use of existing maps, especially for historical research and to compare time periods. For example, this may involve studying how a city has evolved over time or national boundaries have changed. A lot of time and energy in GIS goes into gathering this data and entering it into the computer.

Once the data is in the computer, GIS can perform a wide range and variety of analyses on the data, depending on the questions being asked and the task at hand. For example, the following are some of the many things you can do with GIS:

  • View-shed analysis: This attempts to answer the question, "What can someone standing right here at this elevation ...

Mapping the climate change


So, let's roll up our sleeves and perform some geospatially informed data analysis.

For our problem, we'll look at how the climate change affects the continental United States over the last century or so. Specifically, we'll look at how the average maximum temperature for July has changed. For North America, this should give us a good snapshot of the hottest temperatures.

One nice thing about working with the weather data is that there's a lot of it, and it's easily available. US National Oceanic and Atmospheric Administration (NOAA) collects it and maintains archives of it.

For this project, we'll use the Global Summary of the Day (http://www.ncdc.noaa.gov/cgi-bin/res40.pl). This includes daily summaries from each active weather station. We'll filter out any weather stations that aren't in the US, and we'll filter out any data that is not in use for the month of July.

Climate is typically defined on thirty-year periods. For example, the climate for a location would...

Working with map projections


Have you looked at a world wall map and noticed how big Greenland is? It's huge. It's larger than China, the United States, and Australia, and is about as big as Africa. Too bad it's so cold, or we could fit a lot of people up there. Or could we?

Actually, Australia is about three and a half times as big as Greenland, China is almost four and a half times as big, and Africa is almost fourteen times as large!

What's going on? The Mercator projection is what's going on. It was developed by the Flemish cartographer Gerardus Mercator in 1569. Over time, it's become very popular, at least partially so because it fits nicely onto a rectangular page without wasting a lot of space around the edges, the way some projections do.

A map projection is a transformation of locations on a sphere or ellipsoid onto locations on a plane. You can think of it as a function that transforms latitudes and longitudes of the earth into the x and y coordinates on a sheet of paper. This allows...

Working with ArcGIS


Working with projections and base maps can be fiddly and prone to errors. While there are Java libraries that can help us with this, let's use the major software package in this domain, ArcGIS, for the purposes of this demonstration. While it's awesome to be able to program solutions in a powerful, flexible language like Clojure, sometimes, it's nicer to get pretty pictures quickly.

We're going to start this by getting the base layer. ESRI maintains a set of topological maps, and this map of the United States is perfect for this:

  1. Navigate to http://www.arcgis.com/home/item.html?id=99cd5fbd98934028802b4f797c4b1732 to view ESRI's page on the US Topo Maps.

  2. Click on the Open dropdown.

  3. Select the option that allows you to get ArcGIS Desktop to open the layer.

Now we'll add our data. This was created using the functions that we defined earlier as well as a few more that are available in this chapter's code download:

Summary


This has been a fun little experiment. Looking at the data, however, suggests caution. Some of the stations have been in operation long enough to have only a few of the sliding windows defined. Others have been operational for much longer. This makes it difficult to compare the aggregated numbers from the different different stations, which is what we're doing by creating the heat map.

Nevertheless, this does point to some interesting areas of future enquiry, and it provides a brief glimpse of what geographical information systems can provide and how to use them. They can add a geospatially informed edge to the modeling and analysis, which isn't possible with the data, tools, and techniques they bring to the table.

In this next chapter, we'll turn our attention to sifting through free-form textual data using topic modeling.

Left arrow icon Right arrow icon
Estimated delivery fee Deliver to Switzerland

Standard delivery 10 - 13 business days

€11.95

Premium delivery 3 - 6 business days

€16.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : May 26, 2014
Length: 340 pages
Edition :
Language : English
ISBN-13 : 9781783284139
Category :
Languages :
Concepts :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Switzerland

Standard delivery 10 - 13 business days

€11.95

Premium delivery 3 - 6 business days

€16.95
(Includes tracking information)

Product Details

Publication date : May 26, 2014
Length: 340 pages
Edition :
Language : English
ISBN-13 : 9781783284139
Category :
Languages :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.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
€189.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
€264.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 48.99
Mastering Clojure Data Analysis
€48.99
Total 48.99 Stars icon
Banner background image

Table of Contents

10 Chapters
Network Analysis – The Six Degrees of Kevin Bacon Chevron down icon Chevron up icon
GIS Analysis – Mapping Climate Change Chevron down icon Chevron up icon
Topic Modeling – Changing Concerns in the State of the Union Addresses Chevron down icon Chevron up icon
Classifying UFO Sightings Chevron down icon Chevron up icon
Benford's Law – Detecting Natural Progressions of Numbers Chevron down icon Chevron up icon
Sentiment Analysis – Categorizing Hotel Reviews Chevron down icon Chevron up icon
Null Hypothesis Tests – Analyzing Crime Data Chevron down icon Chevron up icon
A/B Testing – Statistical Experiments for the Web Chevron down icon Chevron up icon
Analyzing Social Data Participation Chevron down icon Chevron up icon
Modeling Stock Data 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.2
(5 Ratings)
5 star 40%
4 star 40%
3 star 20%
2 star 0%
1 star 0%
Charles Feduke May 28, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(This review is for the electronic PDF version of the book; there are some graphs in the book that I understand are printed black and white, and the author makes a PDF of color graphs available for download to accompany the print version.)When I learn a new language or technology I like to read three books at a time; two practical with plenty of examples to follow along with and one that I can read away from the computer (usually about theory or patterns).Eric's excellent Clojure Data Analysis Cookbook [Packt] was one of two of the practical books I read when I was first beginning to work with the language. This book is in the same vein as the cookbook version, but more in-depth on data analysis. The necessary "how do I do this with Clojure" isn't absent nor does it take a back seat.While I've only completed the first chapter I'd say this book is likely a great title for anyone who is an experienced software engineer coming to Clojure. Like the cookbook you'll learn how to write practical elegant Clojure code, not just theory, and a lot about data analysis and how to model data problems with Clojure.The only gripe I have about this book is that the PDF version is inconsistent with its usage of color graphics and black and white graphics; the entire PDF version should present only color figures.
Amazon Verified review Amazon
Rick Beerendonk Jul 07, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I really enjoyed reading this book. It is pleasantly different than most how-to books I have on my bookshelf. The book combines a number of interesting topics in a very readable way. By no means it is an introduction to Clojure or ClojureScript. But both are used extensively and the programs are discussed with enough detail to understand the working of the code, so well suited for the intermediate developer.Having worked on sports statistics, analysing sport events, financial systems and now safety software, there is still a lot to learn and explore. Data analysis was part of all projects, but reading this book showed we only scratched the surface. Mastering Clojure Data Analysis certainly gave me new insights and ideas how to improve the software I am currently working on. The story telling format of the book is well suited for learning. The presented material tend to stick in my mind pretty easy.This book provides applications of a number of well known tools, libraries and techniques, like Leiningen, Ring, D3.js, Reducers, Incanter and Compojure. Since the book uses many external clojure and java libraries, the examples won't run in the .NET implementation of Clojure.
Amazon Verified review Amazon
David J. Brunell Nov 14, 2014
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
As others have mentioned, the material in this book is organized as a series of case studies and is not an exhaustive survey of either Clojure or data analysis. On the one hand, the case-study format makes it easy to follow along with with the author's examples. In doing so, a number of Clojure and data analysis techniques can be learned, some of which will hopefully be useful to you. On the other hand, I often found myself uninterested in the subject material of the examples, and this reduced my desire to work through those examples to the end. A more diligent reader might derive greater benefit.Aside from one paragraph in the preface, the author doesn't spend a lot of time building a case for why one should use Clojure for data analysis, as opposed to R, MATLAB, Python, etc. It would have been nice to include a few example implementations in other languages in order to illustrate why Clojure makes the code more readable, maintainable, extensible, suitable for concurrent processing, etc. Likewise, although we are introduced to a number of libraries like D3.js, MALLET and Weka, the author doesn't go out of his way to justify his choices or even let the reader know what alternatives exist.Overall, despite my reservations, I did find the book quite useful. I approached the subject already sold on the benefits of functional programming in a LISP-based language. Many of the examples introduced me to libraries or aspects of Clojure programming that I didn't previously know about.
Amazon Verified review Amazon
Alfred Xiao Jul 02, 2014
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
I am an experienced programmer in Java, with some experience in Clojure, and I am interested but not an expert in Data Analysis. I have Eric’s previous book - Clojure Data Analysis Cookbook. Although the names of that book and this book (Mastering Clojure Data Analysis) look similar, they cover different aspects. The former talks more about data analysis tools and libraries in Clojure, like Incanter, Cascalog.Yet this book tries to examine case studies and go into more depth from the perspective of data analysis. It doesn’t focus on the technologies that the implementation uses, instead, it walks the reader through many common areas in data analysis, such as (social) network analysis and topic modeling, which in themselves are interesting topics regardless of whether you use Clojure or not to tackle the problem. Having said that, the author also covers important aspects of related libraries and tools well, including the MALLET machine learning library, d3 for data visualization.I like this book as it demonstrates interesting case studies in the data analysis world, and how these problems can be solved using Clojure (backed by libraries/tools which may not be written in Clojure but in Java) in a concise and elegant way.All in all, since the nature of this book is to talk about data analysis using Clojure, it is neither a book about Clojure programming nor a book on the algorithmic aspects of data analysis or how Bayesian works in detail..(from j.mp/McDla you can find official sample chapters)
Amazon Verified review Amazon
david clark Jun 19, 2014
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
First off my disclaimer I volunteered to review 'Mastering Clojure Data Analysis' - http://j.mp/McDla . I did not receive any compensation outside of an electronic copy of the book. I volunteered because of my interests in both Clojure and data analysis. The book is structured in a series of independent chapters modeled like use cases. He does a very good job of covering the problem space and why the algorithm makes sense to use. I would say that the orders of the words in the title would be more appropriately ‘mastering data analysis using clojure’ as clojure isn’t the focus nor should it be. Since the chapters are independent that technology stacks are slightly different – i.e. incanter vs d3js, weka vs mallet etc. There isn’t 100% overlap in those libraries but there is definitely overlap. Also since it made sense to use these libraries the clojure code is really just java interop over them which is the correct and pragmatic choice. That is why I would change the ordering of the title. Overall I would rate this book 3.5/5.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela