Graph Machine Learning
eBook - ePub

Graph Machine Learning

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

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

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
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.
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.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere โ€” even offline. Perfect for commutes or when youโ€™re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
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 Computer Science & Artificial Intelligence (AI) & Semantics. We have over one million books available in our catalogue for you to explore.

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

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