liveBook · Manning

Non-Euclidean data

As explained in Optimization Algorithms: AI techniques for design, planning, and control problems

Non-Euclidean data has relational or geometric structure for which ordinary straight-line distance is not the defining notion of proximity.

Non-Euclidean data has relational or geometric structure for which straight-line distance is not the defining notion of proximity. Graphs express proximity through nodes, edges, and neighborhood structure rather than a regular grid or fixed spatial layout. section 11.3 section 11.3.1

Common forms and learning tasks include:

  • Graphs representing road networks, social networks, web pages, and molecular structures. section 11.3
  • Point clouds, molecules, and manifolds with underlying geometric structure. section 11.3
  • Node classification, link prediction, and community detection after graph embedding or representation learning. section 11.3

A soccer-player graph

Represent each player, club, and nationality as a node. Connect a player to a club with a plays_for relationship and to a nationality with a belongs_to relationship. The resulting graph captures relationships that a table of independent feature vectors does not express directly. section 11.3

Why road networks need relational structure

For estimated travel time, congestion on one road segment can influence neighboring segments. Treating segments as independent samples misses this dependency, whereas graph machine learning can use the network connections. section 11.3.1

Listing 11.1 Converting tabular data to a graph
import pandas as pd
import networkx as nx
import matplotlib.pyplot as plt
  
data={'Player':['L. Messi','R. Lewandowski','C. Ronaldo','Neymar Jr','K. 
 Mbappé','E.Haaland','H. Kane','Luka Modrić','L. Goretzka','M. Salah'],
    'Age':[36,34,38,22,24,35,29,37,28,31],
    'Nationality':['Argentina','Poland','Portugal','Brazil','France','Norway',
    'England','Croatia','Germany','Egypt'],
    'Club':['Inter Miami','Barcelona','Al-Nassr','Al-Hilal ','PSG','Manchester
    City','Tottenham Hotspur','Real Madrid','Bayern Munich','Liverpool'],
    'League':['Major League Soccer ','Spain Primera Division','Saudi Arabia
 League','Saudi Arabia League','French Ligue 1','English Premier
 League','English Premier League','Spain Primera Division','German 1.
 Bundesliga','English Premier League']}
df=pd.DataFrame.from_dict(data)

Inspect a tabular soccer dataset before converting player, club, and nationality relationships into graph edges. section 11.3

Listing 11.2 Node embedding using GCN
import numpy as np
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
from sklearn.pipeline import Pipeline
import torch
import torch.nn.functional as F
from torch_geometric.datasets import Planetoid
from torch_geometric.nn import GCNConv
from torch_geometric.utils import to_networkx

Explore a PyTorch Geometric workflow for producing node embeddings with a graph convolutional network. section 11.3.1

How Optimization Algorithms: AI techniques for design, planning, and control problems covers it

How deep it goes
Defines the Euclidean contrast, identifies major data forms, and reaches graph-convolution implementation without formal geometric treatment.
Examples
Uses soccer-player graphs, road-network ETA prediction, point clouds, molecules, manifolds, and social networks as concrete settings.
What it assumes
Assumes familiarity with nodes, edges, and machine-learning tasks while contrasting graph structure with grid-like data.
What you can do after
Build it from scratch as a graph and apply graph embeddings or GCNs to node-level learning tasks.
How it connects
Connects non-Euclidean data to graphs, geometric deep learning, graph machine learning, graph embedding, and graph convolutional networks.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Optimization Algorithms: AI techniques for design, planning, and control problems. The section links point to the parts of the book it draws on.