Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Clojure Data Analysis

You're reading from  Mastering Clojure Data Analysis

Product type Book
Published in May 2014
Publisher
ISBN-13 9781783284139
Pages 340 pages
Edition 1st Edition
Languages
Author (1):
Eric Richard Rochester Eric Richard Rochester
Profile icon Eric Richard Rochester

Table of Contents (17) Chapters

Mastering Clojure Data Analysis
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Network Analysis – The Six Degrees of Kevin Bacon GIS Analysis – Mapping Climate Change Topic Modeling – Changing Concerns in the State of the Union Addresses Classifying UFO Sightings Benford's Law – Detecting Natural Progressions of Numbers Sentiment Analysis – Categorizing Hotel Reviews Null Hypothesis Tests – Analyzing Crime Data A/B Testing – Statistical Experiments for the Web Analyzing Social Data Participation Modeling Stock Data Index

Understanding graphs


Graphs are the Swiss army knife of computer science data structures. Theoretically, any other data structure can be represented as a graph, although usually, it won't perform as well.

For example, binary trees can be seen as a graph in which each node has two outgoing edges at most. These edges link it to the node's children. Or, an array can be seen as a graph in which each item in the array has edges that link it to the items adjacent to it.

However, in this case, the data that we're working with is naturally represented by a graph. The people in the network are the nodes, and their relationships are the edges.

Graphs come in several flavors, but they all have some things in common. First, they are a series of nodes that are connected by edges. Edges can be unidirectional, in which case, the relationship they represent goes only one way (for example, followers on Twitter), or it goes bidirectional, in which the relationship is two-way (for example, friends on Facebook).

Graphs generally don't have any hierarchy or structure like trees or lists do. However, the data they represent may have a structure. For example, Twitter has a number of users (vertices) who have a lot of followers (inbound edges). However, most users only have a few followers. This dichotomy creates a structure to the graph, where a lot of data flows through a few vertices.

Graphs' data structures typically support a number of operations, including adding edges, removing edges, and traversing the graph. We'll implement a graph data structure later. At that point, we'll also look at these operations. This may not be the best performing graph, especially for very large datasets, but it should help make clear what graphs are all about.

You have been reading a chapter from
Mastering Clojure Data Analysis
Published in: May 2014 Publisher: ISBN-13: 9781783284139
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}