© 2023 Neo4j, Inc. All rights reserved.
© 2023 Neo4j, Inc. All rights reserved.
Graph Machine Learning
in Production with Neo4
Dr. Jesús Barrasa
RVP Solutions Architecture EMEA
© 2023 Neo4j, Inc. All rights reserved.
2
At the heart of every enterprise challenge
is an explosion of data complexity
and organisations that treat their data
right will have a competitive advantage
© 2023 Neo4j, Inc. All rights reserved.
3
TODAY’S REALITY
Connections
in data are as
valuable as the
data itself
© 2023 Neo4j, Inc. All rights reserved.
Legacy
systems
can’t keep up
Relational Databases
don’t handle relationships well
Document Databases
don’t handle relationships at all
© 2023 Neo4j, Inc. All rights reserved.
A fundamentally new approach is needed
5
© 2023 Neo4j, Inc. All rights reserved.
Data, meet Graph.
6
© 2023 Neo4j, Inc. All rights reserved.
Graph creates a
more intuitive and
connected view of
data relationships,
unlocking deeper
insights and context
7
© 2023 Neo4j, Inc. All rights reserved.
THE PROPERTY GRAPH: SIMPLY POWERFUL
Employee City
Company
Nodes represent
objects (nouns)
Relationships are directional
Relationships connect nodes are
represent actions (verbs)
Relationships can have properties
(name/value pairs)
Nodes can have
properties (name/value
pairs)
name: Amy Peters
date_of_birth: 1984-03-01
employee_ID: 1
:HAS_CEO
start_date: 2008-01-20
:LOCATED_IN
8
© 2023 Neo4j, Inc. All rights reserved.
NEO4J: FOR APPLICATIONS AND ANALYTICS
Graph Transactions,
Storage & Querying
Graph Analytics, ML,
& Data Science
Intelligent Applications Better Predictions
© 2023 Neo4j, Inc. All rights reserved.
APPLICATIONS AND ANALYTICS (IN PRACTICE)
APP
Applications APP APP
Databases
Servers
3 primary + 2 secondary 3 primary
Composite Database
Secondary Only (GDS)
“Replica for analytical work”
ML Pipeline
Primary
“Transactional database”
© 2023 Neo4j, Inc. All rights reserved.
APPLICATIONS AND ANALYTICS (IN PRACTICE)
The neo4j platform can take care of “everything” (closed loop)
But you can also use your own etl tool, feature store, model catalogue,
auto ml ….
gds.alpha.graph.construct(
'items_graph',
nodes,
relationships
)
That is why we provide a python client with arrows support … … and connectors
© 2023 Neo4j, Inc. All rights reserved.
SEAMLESS FOR ALL ECOSYSTEMS AND PIPELINES
Graph Data Science
BI & VISUALIZATIONS
INGEST
STORE
PROCESS
Apache
Kafka
MACHINE LEARNING
Cloud
Functions
Neo4j
Bloom
PubSub
DataProc
Analytics
Feature
Engineering
Data
Exploration
Graph
Data
Science
Business
Applications &
Existing Systems
Files (unstructured,
structured)
TensorFlow
KNIME Python
Cloud Storage
AWS
Lambda
12
Graph Database
© 2023 Neo4j, Inc. All rights reserved.
GRAPH DATA SCIENCE
13
Machine Learning Pipeline
Pl
ay
s
Lives_in
In_sport
Likes
F
a
n
_
o
f
Plays_for
K
n
o
w
s
Knows
Knows
K
n
o
w
s
Explore the hidden patterns and features in your data
What’s important? What’s unusual? What’s next?
© 2023 Neo4j, Inc. All rights reserved.
IMPROVE MODELS AND ANSWER BIG QUESTIONS
14
Pathfinding
& Search
Centrality Community
Detection
Machine
Learning
Link
Prediction
Similarity Embeddings And more …
Over 65 pretuned, parallelized algorithms. Iterate fast with different data sets, models,
and version trained models.
Bring the context of your connected data
into a format that other pipelines can ingest.
The Largest Catalog of
Graph Algorithms
Native Graph Catalog and
Analytics Workspace
Graph Embeddings for
Machine Learning
© 2023 Neo4j, Inc. All rights reserved.
15
PATH TO GRAPH DATA SCIENCE
Knowledge Graphs
Graph Algorithms
Graph Native ML
Find the patterns you’re
looking for in connected data
Identify associations,
anomalies, and trends using
unsupervised machine learning
Learn features in your graph
that you don’t even know
are important yet
→
→
© 2023 Neo4j, Inc. All rights reserved.
# Neo4j ML Pipeline
pipeline, _ = gds.beta.pipeline.nodeClassification.create("provider-fraud-pipe")
pipeline.addNodeProperty('fastRP', embeddingDimension=64, mutateProperty='embedding',
relationshipWeightProperty='weight', iterationWeights=[0.0, 1.0, 1.0, 0.7])
pipeline.configureSplit(testFraction=0.3, validationFolds=5)
pipeline.selectFeatures(['embedding'])
pipeline.addLogisticRegression(tolerance=0.00001, maxEpochs=500, penalty=0.0, batchSize=32)
pipeline.addMLP()
pipeline.addRandomForest(maxDepth=20)
pipeline.configureAutoTuning(maxTrials=100)
trained_pipe_model, res = pipeline.train(g_train,
modelName="fraud-model",
targetNodeLabels=['Provider'], targetProperty="fraud_label",
metrics=["ACCURACY", "F1_WEIGHTED"])
result = trained_pipe_model.predict_write(g_train, concurrency=8,
writeProperty="predicted_label",
predictedProbabilityProperty="predicted_probablity")
16
© 2023 Neo4j, Inc. All rights reserved.
Most well connected and influential nodes
Recommendations from shared user interactions and
associations
VISUAL AND EXPLAINABLE RESULTS
17
© 2023 Neo4j, Inc. All rights reserved.
VISUAL AND EXPLAINABLE RESULTS
18
© 2023 Neo4j, Inc. All rights reserved.
19
What’s in it for you:
● Improve model accuracy
● Simplify processes = remove
headaches
● More projects into production
without oversized teams
GRAPH DATA SCIENCE
Analytics
Feature
Engineering
Data
Exploration
Graph
Data
Science
Queries & Search
Machine Learning Visualization
© 2023 Neo4j, Inc. All rights reserved.
FLEXIBLE CLOUD DEPLOYMENT MODELS
20
Graph-as-a-Service Cloud Managed Services Self-hosted
Fully-managed SaaS
Consumption-based pricing
Cloud-native
Self-service deployment
No access to underlying
infrastructure and systems
White-glove managed service
by Neo4j experts
Fully customizable deployment
model and service levels
Operate In own data centers
or Virtual Private Cloud
For private and hybrid
cloud, or on-prem
Bring your own license
Full control of your environment
Run in any cloud, in your account
© 2023 Neo4j, Inc. All rights reserved.
WHAT NEXT?
13:30 Workshop (W6): GPT and Graph
Data Science to power your Knowledge
Graph with Kristof Neys
Come talk to us at booth C68
© 2023 Neo4j, Inc. All rights reserved.
22
“Together we make sense of data”
Thank you

Graph Machine Learning in Production with Neo4j

  • 1.
    © 2023 Neo4j,Inc. All rights reserved. © 2023 Neo4j, Inc. All rights reserved. Graph Machine Learning in Production with Neo4 Dr. Jesús Barrasa RVP Solutions Architecture EMEA
  • 2.
    © 2023 Neo4j,Inc. All rights reserved. 2 At the heart of every enterprise challenge is an explosion of data complexity and organisations that treat their data right will have a competitive advantage
  • 3.
    © 2023 Neo4j,Inc. All rights reserved. 3 TODAY’S REALITY Connections in data are as valuable as the data itself
  • 4.
    © 2023 Neo4j,Inc. All rights reserved. Legacy systems can’t keep up Relational Databases don’t handle relationships well Document Databases don’t handle relationships at all
  • 5.
    © 2023 Neo4j,Inc. All rights reserved. A fundamentally new approach is needed 5
  • 6.
    © 2023 Neo4j,Inc. All rights reserved. Data, meet Graph. 6
  • 7.
    © 2023 Neo4j,Inc. All rights reserved. Graph creates a more intuitive and connected view of data relationships, unlocking deeper insights and context 7
  • 8.
    © 2023 Neo4j,Inc. All rights reserved. THE PROPERTY GRAPH: SIMPLY POWERFUL Employee City Company Nodes represent objects (nouns) Relationships are directional Relationships connect nodes are represent actions (verbs) Relationships can have properties (name/value pairs) Nodes can have properties (name/value pairs) name: Amy Peters date_of_birth: 1984-03-01 employee_ID: 1 :HAS_CEO start_date: 2008-01-20 :LOCATED_IN 8
  • 9.
    © 2023 Neo4j,Inc. All rights reserved. NEO4J: FOR APPLICATIONS AND ANALYTICS Graph Transactions, Storage & Querying Graph Analytics, ML, & Data Science Intelligent Applications Better Predictions
  • 10.
    © 2023 Neo4j,Inc. All rights reserved. APPLICATIONS AND ANALYTICS (IN PRACTICE) APP Applications APP APP Databases Servers 3 primary + 2 secondary 3 primary Composite Database Secondary Only (GDS) “Replica for analytical work” ML Pipeline Primary “Transactional database”
  • 11.
    © 2023 Neo4j,Inc. All rights reserved. APPLICATIONS AND ANALYTICS (IN PRACTICE) The neo4j platform can take care of “everything” (closed loop) But you can also use your own etl tool, feature store, model catalogue, auto ml …. gds.alpha.graph.construct( 'items_graph', nodes, relationships ) That is why we provide a python client with arrows support … … and connectors
  • 12.
    © 2023 Neo4j,Inc. All rights reserved. SEAMLESS FOR ALL ECOSYSTEMS AND PIPELINES Graph Data Science BI & VISUALIZATIONS INGEST STORE PROCESS Apache Kafka MACHINE LEARNING Cloud Functions Neo4j Bloom PubSub DataProc Analytics Feature Engineering Data Exploration Graph Data Science Business Applications & Existing Systems Files (unstructured, structured) TensorFlow KNIME Python Cloud Storage AWS Lambda 12 Graph Database
  • 13.
    © 2023 Neo4j,Inc. All rights reserved. GRAPH DATA SCIENCE 13 Machine Learning Pipeline Pl ay s Lives_in In_sport Likes F a n _ o f Plays_for K n o w s Knows Knows K n o w s Explore the hidden patterns and features in your data What’s important? What’s unusual? What’s next?
  • 14.
    © 2023 Neo4j,Inc. All rights reserved. IMPROVE MODELS AND ANSWER BIG QUESTIONS 14 Pathfinding & Search Centrality Community Detection Machine Learning Link Prediction Similarity Embeddings And more … Over 65 pretuned, parallelized algorithms. Iterate fast with different data sets, models, and version trained models. Bring the context of your connected data into a format that other pipelines can ingest. The Largest Catalog of Graph Algorithms Native Graph Catalog and Analytics Workspace Graph Embeddings for Machine Learning
  • 15.
    © 2023 Neo4j,Inc. All rights reserved. 15 PATH TO GRAPH DATA SCIENCE Knowledge Graphs Graph Algorithms Graph Native ML Find the patterns you’re looking for in connected data Identify associations, anomalies, and trends using unsupervised machine learning Learn features in your graph that you don’t even know are important yet → →
  • 16.
    © 2023 Neo4j,Inc. All rights reserved. # Neo4j ML Pipeline pipeline, _ = gds.beta.pipeline.nodeClassification.create("provider-fraud-pipe") pipeline.addNodeProperty('fastRP', embeddingDimension=64, mutateProperty='embedding', relationshipWeightProperty='weight', iterationWeights=[0.0, 1.0, 1.0, 0.7]) pipeline.configureSplit(testFraction=0.3, validationFolds=5) pipeline.selectFeatures(['embedding']) pipeline.addLogisticRegression(tolerance=0.00001, maxEpochs=500, penalty=0.0, batchSize=32) pipeline.addMLP() pipeline.addRandomForest(maxDepth=20) pipeline.configureAutoTuning(maxTrials=100) trained_pipe_model, res = pipeline.train(g_train, modelName="fraud-model", targetNodeLabels=['Provider'], targetProperty="fraud_label", metrics=["ACCURACY", "F1_WEIGHTED"]) result = trained_pipe_model.predict_write(g_train, concurrency=8, writeProperty="predicted_label", predictedProbabilityProperty="predicted_probablity") 16
  • 17.
    © 2023 Neo4j,Inc. All rights reserved. Most well connected and influential nodes Recommendations from shared user interactions and associations VISUAL AND EXPLAINABLE RESULTS 17
  • 18.
    © 2023 Neo4j,Inc. All rights reserved. VISUAL AND EXPLAINABLE RESULTS 18
  • 19.
    © 2023 Neo4j,Inc. All rights reserved. 19 What’s in it for you: ● Improve model accuracy ● Simplify processes = remove headaches ● More projects into production without oversized teams GRAPH DATA SCIENCE Analytics Feature Engineering Data Exploration Graph Data Science Queries & Search Machine Learning Visualization
  • 20.
    © 2023 Neo4j,Inc. All rights reserved. FLEXIBLE CLOUD DEPLOYMENT MODELS 20 Graph-as-a-Service Cloud Managed Services Self-hosted Fully-managed SaaS Consumption-based pricing Cloud-native Self-service deployment No access to underlying infrastructure and systems White-glove managed service by Neo4j experts Fully customizable deployment model and service levels Operate In own data centers or Virtual Private Cloud For private and hybrid cloud, or on-prem Bring your own license Full control of your environment Run in any cloud, in your account
  • 21.
    © 2023 Neo4j,Inc. All rights reserved. WHAT NEXT? 13:30 Workshop (W6): GPT and Graph Data Science to power your Knowledge Graph with Kristof Neys Come talk to us at booth C68
  • 22.
    © 2023 Neo4j,Inc. All rights reserved. 22 “Together we make sense of data” Thank you