Graph Machine Learning
eBook - ePub

Graph Machine Learning

Claudio Stamile, Aldo Marzullo, Enrico Deusebio

Share book
  1. 338 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Graph Machine Learning

Claudio Stamile, Aldo Marzullo, Enrico Deusebio

Book details
Book preview
Table of contents
Citations

About This Book

Build machine learning algorithms using graph data and efficiently exploit topological information within your modelsKey Features• Implement machine learning techniques and algorithms in graph data• Identify the relationship between nodes in order to make better business decisions• Apply graph-based machine learning methods to solve real-life problemsBook DescriptionGraph Machine Learning will introduce you to a set of tools used for processing network data and leveraging the power of the relation between entities that can be used for predictive, modeling, and analytics tasks. The first chapters will introduce you to graph theory and graph machine learning, as well as the scope of their potential use. You'll then learn all you need to know about the main machine learning models for graph representation learning: their purpose, how they work, and how they can be implemented in a wide range of supervised and unsupervised learning applications. You'll build a complete machine learning pipeline, including data processing, model training, and prediction in order to exploit the full potential of graph data. After covering the basics, you'll be taken through real-world scenarios such as extracting data from social networks, text analytics, and natural language processing (NLP) using graphs and financial transaction systems on graphs. You'll also learn how to build and scale out data-driven applications for graph analytics to store, query, and process network information, and explore the latest trends on graphs. By the end of this machine learning book, you will have learned essential concepts of graph theory and all the algorithms and techniques used to build successful machine learning applications.What you will learn• Write Python scripts to extract features from graphs• Distinguish between the main graph representation learning techniques• Learn how to extract data from social networks, financial transaction systems, for text analysis, and more• Implement the main unsupervised and supervised graph embedding techniques• Get to grips with shallow embedding methods, graph neural networks, graph regularization methods, and more• Deploy and scale out your application seamlesslyWho this book is forThis book is for data scientists, data analysts, graph analysts, and graph professionals who want to leverage the information embedded in the connections and relations between data points to boost their analysis and model performance using machine learning. It will also be useful for machine learning developers or anyone who wants to build ML-driven graph databases. A beginner-level understanding of graph databases and graph data is required, alongside a solid understanding of ML basics. You'll also need intermediate-level Python programming knowledge to get started with this book.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Graph Machine Learning an online PDF/ePUB?
Yes, you can access Graph Machine Learning by Claudio Stamile, Aldo Marzullo, Enrico Deusebio in PDF and/or ePUB format, as well as other popular books in Ciencia de la computación & Tratamiento de datos. We have over one million books available in our catalogue for you to explore.

Information

Year
2021
ISBN
9781800206755

Section 1 – Introduction to Graph Machine Learning

In this section, the reader will get a brief introduction to graph machine learning, showing the potential of graphs combined with the right machine learning algorithms. Moreover, a general overview of graph theory and Python libraries is provided in order to allow the reader to deal with (that is, create, modify, and plot) graph data structures.
This section comprises the following chapters:
  • Chapter 1, Getting Started with Graphs
  • Chapter 2, Graph Machine Learning

Chapter 1: Getting Started with Graphs

Graphs are mathematical structures that are used for describing relations between entities and are used almost everywhere. For example, social networks are graphs, where users are connected depending on whether one user "follows" the updates of another user. They can be used for representing maps, where cities are linked through streets. Graphs can describe biological structures, web pages, and even the progression of neurodegenerative diseases.
Graph theory, the study of graphs, has received major interest for years, leading people to develop algorithms, identify properties, and define mathematical models to better understand complex behaviors.
This chapter will review some of the concepts behind graph-structured data. Theoretical notions will be presented, together with examples to help you understand some of the more general concepts and put them into practice. In this chapter, we will introduce and use some of the most widely used libraries for the creation, manipulation, and study of the structure dynamics and functions of complex networks, specifically looking at the Python networkx library.
The following topics will be covered in this chapter:
  • Introduction to graphs with networkx
  • Plotting graphs
  • Graph properties
  • Benchmarks and repositories
  • Dealing with large graphs

Technical requirements

We will be using Jupyter Notebooks with Python 3.8 for all of our exercises. In the following code snippet, we show a list of Python libraries that will be installed for this chapter using pip (for example, run pip install networkx==2.5 on the command line, and so on):
Jupyter==1.0.0
networkx==2.5
snap-stanford==5.0.0
matplotlib==3.2.2
pandas==1.1.3
scipy==1.6.2
In this book, the following Python commands will be referred to:
  • import networkx as nx
  • import pandas as pd
  • import numpy as np
For more complex data visualization tasks, Gephi (https://gephi.org/) is also required. The installation manual is available here: https://gephi.org/users/install/. All code files relevant to this chapter are available at https://github.com/PacktPublishing/Graph-Machine-Learning/tree/main/Chapter01.

Introduction to graphs with networkx

In this section, we will give a general introduction to graph theory. Moreover, in order to merge theoretical concepts with their practical implementation, we will enrich our explanation with code snippets in Python, using networkx.
A simple undirected graph (or simply, a graph) G is defined as a couple G=(V,E) , where V={
, ..,
} is a set of nodes (also called vertices) and E={{
,
.., {
,
}} is a set of two-sets (set of two elements) of edges (also called links), representing the connection between two nodes belonging to V.
It is important to underline that since each element of E is a two-set, there is no order between each edge. To provide more detail, {
,
and {
,
represent the same edge.
We now provide definitions for some basic properties of graphs and nodes, as follows:
  • The order of a graph is the number of its vertices |V|. The size of a graph is the number of its edges |E|.
  • The degree of a vertex is the number of edges that are adjacent to it. The neighbors of a vertex v in a graph G is a subset of vertex
    induced by all vertices adjacent to v.
  • The neighborhood graph (also known as an ego graph) of a vertex v in a graph G is a subgraph of G, composed of the vertices adjacent to v and all edges connecting vertices adjacent to v.
An example of what a graph looks like can be seen in the following screenshot:
Figure 1.1 – Example of a graph
Figure 1.1 – Example of a graph
According to this representation, since there is no direction, an edge from Milan to Paris is equal to an edge from Paris to Milan. Thus, it is possible to move in the two directions without any constraint. If we analyze the properties of the graph depicted in Figure 1.1, we can see that it has order and size equal to 4 (there are, in total, four vertices and four edges). The Paris and Dublin vertices have degree 2, Milan has degree 3, and Rome has degree 1. The n...

Table of contents