using graphs for recommendations

33
Data Science in Marke-ng [email protected] @ rvanbruggen

Upload: rik-van-bruggen

Post on 20-Jun-2015

4.394 views

Category:

Software


3 download

DESCRIPTION

How can you use a graph database for making useful recommendations?

TRANSCRIPT

Page 1: Using graphs for recommendations

Data  Science    in    

Marke-ng  [email protected]  

@rvanbruggen  

Page 2: Using graphs for recommendations

Graphs  for  

Recommenda-ons  [email protected]  

@rvanbruggen  

Page 3: Using graphs for recommendations

Agenda  •  About  Graphs  •  About  Graph  Databases  •  Why  Graph  Databases  ma=er  for  Recommenda?ons  –  Short  demonstra?on  

•  Case  Studies  •  Q&A  

Page 4: Using graphs for recommendations

Introduc?on:  about  Graphs  

Page 5: Using graphs for recommendations
Page 6: Using graphs for recommendations

Meet ���Leonhard Euler •  Swiss  mathema?cian  •  Inventor  of  Graph  Theory  (1736)  

Page 7: Using graphs for recommendations

Königsberg  (Prussia)  -­‐  1736  

Page 8: Using graphs for recommendations

A

B

D

C

Page 9: Using graphs for recommendations

A

B

D

C

1"

2"3"

4"

7"6"

5"

Page 10: Using graphs for recommendations

About  Graph  Databases  

Page 11: Using graphs for recommendations

So  what  is  a  graph  database?  

•  OLTP  database  – “end-­‐user”  transac?ons  

•  Model,  store,  manage  data  as  a  graph  

Page 12: Using graphs for recommendations

What  is  a  graph?  Node  

Rela?onship  

Page 13: Using graphs for recommendations

Contrast  with  Rela?onal  

Graphs are often referred to as “Whiteboard Friendly”. The data model reflects the way a domain expert would naturally

draw their data on a whiteboard “The schema is the data”. Schema flexibility allows the system

to change in response to a changing environment

Page 14: Using graphs for recommendations

What  are  graphs  good  for?  

Complex  Querying  

Page 15: Using graphs for recommendations

Examples  of  complex  queries?  1.  Semi-­‐structure  in  datasets  

15

– Normaliza?on  introduces  complexity  

– Forces  developers  to  develop  all  kinds  of  logic  to  deal  with  this  variability  in  their  applica?on  logic  

Page 16: Using graphs for recommendations

Examples  of  complex  queries:  2.  Connectedness  in  data  

Lots  of  normalized  rela?onships  between  the  different  en??es,  forces  developers  to  do  •  Deep  joins  •  Recursive  joins  •  Pathfinding  opera?ons  •  “open-­‐ended”  queries  

Page 17: Using graphs for recommendations

Examples  of  Connectedness  

Page 18: Using graphs for recommendations

Graphs  in  Recommenda-ons?  

Page 19: Using graphs for recommendations

Recommender  system  

•  Not  new  •  Prime  BI  applica?on  – Mining  data  – Calcula?ng  recommenda?ons  /  promo?ons  in  batch  

– Presen?ng  these  to  the  user  online  /  offline  

19

Page 20: Using graphs for recommendations

Recommender  systems  

Page 21: Using graphs for recommendations

Graphs  in  Recommender  Systems  

•  Real  ?me  aspect  •  Recommenda?on  Prac?ces  rely  on  Graph  Algorithms  

•  Opera?onal    efficiency  

Page 22: Using graphs for recommendations

Real  -me  recommenda?ons?  

•  Context  is  everything  –  You  don’t  want  to  be  recommending  a  fitness  

subscrip?on  when  you  have  just  been  admi=ed  to  hospital…  

•  Relevance  is  King  –  More  ‘s?cky’  applica?ons  –  Increase  user  sa?sfac?on  –  Drive  traffic:  get  users  to  do  more  stuff  with  your  

applica?on  

Page 23: Using graphs for recommendations

Recommenda?on  prac?ces:  Graph  Algorithms  

●  Helpful  for  naviga?ng  complex  networks  ●  tell  me  how  A  and  B  are  related  ●  The  things  on  the  path  between  A  and  B  could  very  well  be  

interes?ng  ●  ShortestPath,  AllShortestPaths,  Weighted  ShortestPath  (Dijkstra,  A*)  

●  Helpful  for  understanding  the  important  parts  of  a  network  ●  Clusters  ●  Bridges  

●  Centrality  ●  Betweenness  Centrality  

●  (Page)Ranking  

Page 24: Using graphs for recommendations

Recommenda?on  prac?ces:  Making  triangles  

●  Close  the  triangle  to  make  a  recommenda?on  ●  Olen  looking  for  “missing  links”  ●  e.g.  making  a  recommenda?on  of  movies  based  on  what  similar  users  

have  enjoyed    

Page 25: Using graphs for recommendations

Opera-onal  Efficiency  

•  Graph  datamodel  removes  the  need  for  many  “batch  opera?ons”  – No  need  to  precalculate  –  just  feed  it  into  the  graph  

•  Complex  pa=ern  matching  in  milliseconds  •  Graph  Locality  ==  Predictability  &  Speed,  even  over  large  datasets  

Page 26: Using graphs for recommendations

Short  demo  

Page 27: Using graphs for recommendations

Use  Cases  (neo4j.com/use-­‐cases)  

Page 28: Using graphs for recommendations

Customers  (neo4j.com/customers)  

Page 29: Using graphs for recommendations

Graph  Gists  (h=p://gist.neo4j.org/)  

Page 30: Using graphs for recommendations

Neo Technology, Inc Confidential

Neo4j License Overview

Developer!Seats!

($6K*/Developer/Year)

Test!Instances!

($6K/Instance/Year)

Production!Instances!

(Bundle / Core Pricing)

Instances whose purpose is to ensure that the software accessing

Neo4j is meeting specification.!!

(e.g. System Test, Integration Test, UAT, Performance Test, Staging)

Instances that store and process data in a way that benefits and

advances an organization’s goals.!!

May be accessed by applications and/or end users

Includes access by programmers to licensed test instances, and

private instances on the programmer’s personal machine for the sole purpose of writing, debugging, or testing software

designed to access Neo4j

*Or otherwise, depending on the Bundle, and negotiation

Neo4j  versions  /  licenses  

Personal  <  Startup  /  Departmental  <  Enterprise  deployment  models  Open  source  &  Commercial  license  terms  available  

Specific  OEM  models  

Page 31: Using graphs for recommendations

Future  trainings  &  events!  

31

Page 32: Using graphs for recommendations

Conway  Hall,  November  13th  

bit.ly/graphday

Page 33: Using graphs for recommendations

Neo  Technology  www.neotechnology.com    Neo4j  www.neo4j.org      [email protected]  or  +32  478  686800  

Q&A,  Conclusion,  Next  Steps