Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Graph Machine Learning

You're reading from  Graph Machine Learning

Product type Book
Published in Jun 2021
Publisher Packt
ISBN-13 9781800204492
Pages 338 pages
Edition 1st Edition
Languages
Authors (3):
Claudio Stamile Claudio Stamile
Profile icon Claudio Stamile
Aldo Marzullo Aldo Marzullo
Profile icon Aldo Marzullo
Enrico Deusebio Enrico Deusebio
Profile icon Enrico Deusebio
View More author details

Table of Contents (15) Chapters

Preface Section 1 – Introduction to Graph Machine Learning
Chapter 1: Getting Started with Graphs Chapter 2: Graph Machine Learning Section 2 – Machine Learning on Graphs
Chapter 3: Unsupervised Graph Learning Chapter 4: Supervised Graph Learning Chapter 5: Problems with Machine Learning on Graphs Section 3 – Advanced Applications of Graph Machine Learning
Chapter 6: Social Network Graphs Chapter 7: Text Analytics and Natural Language Processing Using Graphs Chapter 8:Graph Analysis for Credit Card Transactions Chapter 9: Building a Data-Driven Graph-Powered Application Chapter 10: Novel Trends on Graphs Other Books You May Enjoy

Network topology and community detection

In this section, we are going to analyze some graph metrics to have a clear picture of the general structure of the graph. We will be using networkx to compute most of the useful metrics we have seen in Chapter 1, Getting Started with Graphs. We will try to interpret the metrics to gain insights into the graph.

Network topology

A good starting point for our analysis is the extraction of simple graph metrics to have a general understanding of the main properties of bipartite and tripartite transaction graphs.

We start by looking at the distribution of the degree for both bipartite and tripartite graphs using the following code:

for G in [G_bu, G_tu]:
  plt.figure(figsize=(10,10))
  degrees = pd.Series({k: v for k, v in nx.degree(G)})
  degrees.plot.hist()
  plt.yscale("log")

By way of a result, we get the plot in the following diagram:

Figure 8.3 – Degree...

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}