• Save
ソーシャルグラフ分析
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

ソーシャルグラフ分析

on

  • 5,951 views

About introduction to social graph analysis.

About introduction to social graph analysis.

Statistics

Views

Total Views
5,951
Views on SlideShare
5,844
Embed Views
107

Actions

Likes
22
Downloads
3
Comments
2

10 Embeds 107

http://kimuras.hatenablog.com 30
https://twitter.com 22
http://twitter.com 20
http://a0.twimg.com 12
http://paper.li 8
http://www.linkedin.com 8
http://pinterest.com 4
https://www.chatwork.com 1
https://si0.twimg.com 1
https://www.linkedin.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • すごくわかりやすいです。
    Are you sure you want to
    Your message goes here
    Processing…
  • Hello friend,

    how are you today i hope that every things is ok with you as is my pleasure to contact you after viewing your profile today and it interest me in having communication with you if you will have the desire with me so that we can get to know each other better and see what happened in future.i will be very happy if you can write me through my email for easiest communication and to know all about each other,here is my email [ favorfumba100@yahoo.in ] favour to hear from you as i wish you all the best for your day.please do not come to this site always do all you can to write direct to this my private email address_-________________________ [ favorfumba100@yahoo.in ] and i believe that we can bring out
    peace and love and also good understanding in our togetherness. in my nest mail to you i will tell you all about my self with my picture
    thanks. and remember to send your private email address to me

    yours new friend.favour
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • ・TCもmysqlも現役だし、大好き\n
  • ・TCもmysqlも現役だし、大好き\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

ソーシャルグラフ分析 Presentation Transcript

  • 1. • ( ) • @kimuras• G(2007 )• ••
  • 2. Agenda• Introduction• The past work• Introduction to GraphDB• Introduction to Neo4j• Introduction to analysis sample
  • 3. Introduction
  • 4. Motivation for social graph analysis
  • 5. mixi 30000000 ID 22500000# of member id 15000000 7500000 0 2007 2008 2009 2010 2011 year
  • 6. What is Social Graph?
  • 7. Feed Back
  • 8. Feed Back
  • 9. Feed Back
  • 10. Feed Back
  • 11. Feed Back
  • 12. Approach for SG analysis Feed Back
  • 13. The past work
  • 14. ••
  • 15. Relational Databases Dump & Denormalizationfrom_id to_id id name age Key value1 2 1 Kimura 18 From:1 2,31 3 2 kato 45 From:2 32 3 3 ito 21 Prof:1 Kimura,18 Prof:2 Kato,45
  • 16. Relational Databases Dump & reimplementation Denormalizationfrom_id to_id id name age Key value11 2 3 maintenance cost 1 2 Kimura kato 18 45 From:1 From:2 2,3 32 3 3 ito 21 Prof:1 Kimuras,18 Prof:2 Kato,45 scalability
  • 17. Introduction to GraphDB
  • 18. What is graph
  • 19. What is graph Vertex (node : )
  • 20. What is graph Vertex (node : )Edge ( )
  • 21. What is graph Vertex (node : ) Undirected graph ( )Edge ( )
  • 22. What is graph Vertex (node : )Edge ( )
  • 23. What is graph Vertex (node : )Edge ( )
  • 24. What is graph Vertex (node : )Edge ( )
  • 25. What is graph Vertex (node : ) Directed graph ( )Edge ( )
  • 26. What is GraphDB Vertex (node : )Edge ( )
  • 27. What is GraphDBID: 1 Vertex (node : )NAME: kimuraPROP: MaleAGE: 18Edge ( )
  • 28. What is GraphDBID: 1 Vertex (node : )NAME: kimuraPROP: MaleAGE: 18Edge ( ) ID: 2 NAME: ITO PROP: Female AGE: 21
  • 29. What is GraphDBID: 1 Vertex (node : )NAME: kimuraPROP: MaleAGE: 18Edge ( ) ID: 2 NAME: ITO PROP: Female AGE: 21
  • 30. What is GraphDBID: 1 Vertex (node : )NAME: kimuraPROP: MaleAGE: 18Edge ( ) ID: 2 NAME: ITO PROP: Female AGE: 21
  • 31. What is GraphDBID: 1 Vertex (node : )NAME: kimuraPROP: MaleAGE: 18 Edge ( ) ID: 2ID: 3 NAME: ITOLABEL: Like PROP: FemaleSince: 2011/08/06 AGE: 21OutGoing: 2
  • 32. What is GraphDBID: 1 Vertex (node : )NAME: kimuraPROP: MaleAGE: 18 Edge ( ) ID: 2ID: 3 NAME: ITOLABEL: Like PROP: FemaleSince: 2011/08/06 AGE: 21OutGoing: 2
  • 33. What is GraphDBID: 1 Vertex (node : )NAME: kimuraPROP: MaleAGE: 18 Edge ( ) ID: 2ID: 3 NAME: ITOLABEL: Like PROP: FemaleSince: 2011/08/06 AGE: 21OutGoing: 2
  • 34. The implementations for GraphDB http://en.wikipedia.org/wiki/GraphDB
  • 35. Introduction to Neo4j
  • 36. GraphDB Neo4j • True ACID transactions • High availability • Scales to billions of nods and relationships • High speed querying through traversals Single instance(GPLv3) Multiple instance(AGPLv3)Embedded EmbeddedGraphDatabase HighlyAvailableGraphDatabaseStandalone Neo4j Server Neo4j Server high availability mode http://neo4j.org/
  • 37. Other my favorite features for Neo4j• RESTful APIs• Query Language(Cypher)• Full indexing – lucene• Implemented graph algorithm – A*, Dijkstra – High speed traverse• Gremlin supported – Like a query language http://www.tinkerpop.com/post/4633229547/tinkerpop-graph-stack
  • 38. Introduction simple Neo4j usecase Single node Multi nodeEmbedded Analyses system Analyses system Analyses system Analyses systemServer
  • 39. Introduction simple Neo4j usecase Single node Multi nodeEmbedded Analyses system Analyses system Analyses system Analyses systemServer
  • 40. Introduction simple Neo4j usecase Single node Multi node Analyses systemEmbedded Analyses system Analyses system Analyses systemServer
  • 41. Introduction simple Neo4j usecase Single node Multi node Analyses systemEmbedded Analyses system Analyses system Analyses systemServer
  • 42. Introduction to simple embedded Neo4j• Insert Vertices & make Relationships • Single node & Embedded• Traversal sample
  • 43. Insert vertices, make relationshippublic final class InputVertex { public static void main(final String[] args) { GraphDatabaseService graphDb = new EmbeddedGraphDatabase("/tmp/neo4j"); Transaction tx = graphDb.beginTx(); try { Node firstNode = graphDb.createNode(); firstNode.setProperty("Name", "Kimura"); Node secondNode = graphDb.createNode(); secondNode.setProperty("Name", "Kato"); firstNode.createRelationshipTo(secondNode, DynamicRelationshipType.withName("LIKE")); tx.success(); } finally { tx.finish(); } graphDb.shutdown(); }}
  • 44. Insert vertices, make relationshippublic final class InputVertex { public static void main(final String[] args) { GraphDatabaseService graphDb = new EmbeddedGraphDatabase("/tmp/neo4j"); Transaction tx = graphDb.beginTx(); try { Node firstNode = graphDb.createNode(); firstNode.setProperty("Name", "Kimura"); Node secondNode = graphDb.createNode(); secondNode.setProperty("Name", "Kato"); firstNode.createRelationshipTo(secondNode, DynamicRelationshipType.withName("LIKE")); tx.success(); } finally { tx.finish(); } graphDb.shutdown(); }}
  • 45. Insert vertices, make relationshippublic final class InputVertex { public static void main(final String[] args) { ID: 1 GraphDatabaseService graphDb = new NAME: kimura EmbeddedGraphDatabase("/tmp/neo4j"); Transaction tx = graphDb.beginTx(); try { Node firstNode = graphDb.createNode(); firstNode.setProperty("Name", "Kimura"); Node secondNode = graphDb.createNode(); secondNode.setProperty("Name", "Kato"); firstNode.createRelationshipTo(secondNode, DynamicRelationshipType.withName("LIKE")); tx.success(); } finally { tx.finish(); } graphDb.shutdown(); }}
  • 46. Insert vertices, make relationshippublic final class InputVertex { public static void main(final String[] args) { ID: 1 GraphDatabaseService graphDb = new NAME: kimura EmbeddedGraphDatabase("/tmp/neo4j"); Transaction tx = graphDb.beginTx(); try { Node firstNode = graphDb.createNode(); firstNode.setProperty("Name", "Kimura"); Node secondNode = graphDb.createNode(); secondNode.setProperty("Name", "Kato"); firstNode.createRelationshipTo(secondNode, DynamicRelationshipType.withName("LIKE")); tx.success(); } finally { tx.finish(); } graphDb.shutdown(); }}
  • 47. Insert vertices, make relationshippublic final class InputVertex { public static void main(final String[] args) { ID: 1 GraphDatabaseService graphDb = new NAME: kimura EmbeddedGraphDatabase("/tmp/neo4j"); Transaction tx = graphDb.beginTx(); try { Node firstNode = graphDb.createNode(); firstNode.setProperty("Name", "Kimura"); Node secondNode = graphDb.createNode(); secondNode.setProperty("Name", "Kato"); firstNode.createRelationshipTo(secondNode, DynamicRelationshipType.withName("LIKE")); tx.success(); } finally { ID: 2 tx.finish(); NAME: Kato } graphDb.shutdown(); }}
  • 48. Insert vertices, make relationshippublic final class InputVertex { public static void main(final String[] args) { ID: 1 GraphDatabaseService graphDb = new NAME: kimura EmbeddedGraphDatabase("/tmp/neo4j"); Transaction tx = graphDb.beginTx(); try { Node firstNode = graphDb.createNode(); firstNode.setProperty("Name", "Kimura"); Node secondNode = graphDb.createNode(); secondNode.setProperty("Name", "Kato"); firstNode.createRelationshipTo(secondNode, DynamicRelationshipType.withName("LIKE")); tx.success(); } finally { ID: 2 tx.finish(); NAME: Kato } graphDb.shutdown(); }}
  • 49. Insert vertices, make relationshippublic final class InputVertex { public static void main(final String[] args) { ID: 1 GraphDatabaseService graphDb = new NAME: kimura EmbeddedGraphDatabase("/tmp/neo4j"); Transaction tx = graphDb.beginTx(); try { Node firstNode = graphDb.createNode(); ID: 3 firstNode.setProperty("Name", "Kimura"); Relation: Like Node secondNode = graphDb.createNode(); secondNode.setProperty("Name", "Kato"); firstNode.createRelationshipTo(secondNode, DynamicRelationshipType.withName("LIKE")); tx.success(); } finally { ID: 2 tx.finish(); NAME: Kato } graphDb.shutdown(); }}
  • 50. Batch Insert • Non thread safe, non transaction • But very fast!public final class Batch { public static void main(final String[] args) { BatchInserter inserter = new BatchInserterImpl("/tmp/neo4j", BatchInserterImpl.loadProperties("/tmp/neo4j.props")); Map<String, Object> prop = new HashMap<String, Object>(); prop.put("Name", "Kimura"); prop.put("Age", 21); long node1 = inserter.createNode(prop); prop.put("Name", "Kato"); prop.put("Age", 21); long node2 = inserter.createNode(prop); inserter.createRelationship(node1, node2, DynamicRelationshipType.withName("LIKE"), null); inserter.shutdown(); }}
  • 51. Traversal sample •public static void main(final String[] args) { GraphDatabaseService graphDB = new EmbeddedGraphDatabase(args[0]); Node node = graphDB.getNodeById(1); Traverser friends = node.traverse( // Order.DEPTH_FIRST, BREADTH_FIRST // StopEvaluator.END_OF_GRAPH, DEPTH_ONE // ReturnableEvaluator.ALL_BUT_START_NODE, ALL, isReturnableNode() // DynamicRelationshipType.withName("LIKE"), // Direction.OUTGOING); INCOMING, BOTH for (Node nodeBuf : friends) { TraversalPosition currentPosition = friends.currentPosition(); } }
  • 52. Traversal sample Order.BREADTH_FIRST•
  • 53. Traversal sample Order.BREADTH_FIRST•
  • 54. Traversal sample Order.BREADTH_FIRST•
  • 55. Traversal sample Order.BREADTH_FIRST•
  • 56. Traversal sample Order.BREADTH_FIRST•
  • 57. Traversal sample Order.BREADTH_FIRST•
  • 58. Traversal sample Order.DEPTH_FIRST•
  • 59. Traversal sample Order.DEPTH_FIRST•
  • 60. Traversal sample Order.DEPTH_FIRST•
  • 61. Traversal sample Order.DEPTH_FIRST•
  • 62. Traversal sample Order.DEPTH_FIRST•
  • 63. Traversal sample Order.DEPTH_FIRST•
  • 64. Neoclipse sample http://wiki.neo4j.org/content/Neoclipse
  • 65. experiment• mixi Neo4j• • Machine: 24 core CPU, Memory 65GB • Neo4j: BatchInsert, community, embedded• Data • 1500 6 513m17sec (about 8.6h)
  • 66. Network Dataset• Stanford Large Network Dataset Collection • SNAP has a Wide variety of graph data! Social Networks Communication networks Citation networks Collaboration networks Web graphs Product co-purchasing networks Internet peer-to-peer networks Road networks Autonomous systems graphs Signed networks Wikipedia networks and metadata Memetracker and Twitter http://snap.stanford.edu/data/index.html
  • 67. Introduction to Analysis Sample
  • 68. Architecture Service Database Analysis Visualization(Social Graph)
  • 69. Introduction Analyses Sample• Centrality ( )• Clustering coefficient ( )
  • 70. Centrality ( )• = Pagerank
  • 71. •• = Vertex ( )
  • 72. •• = Vertex ( ) 1 1 1
  • 73. •• = Vertex ( ) 2 1 1 2 1 2
  • 74. •• = Vertex ( ) 2 1 1 2 1 2
  • 75. •• = Vertex ( ) 2 1 1 4 2 1 2
  • 76. •• = Vertex ( ) 2 1 1 4 2 1 2
  • 77. mixi • 1000 • summaryMin 1st Que. Median Mean 3rd Que. Max1.00 3.00 10.00 25.69 30.00 903.00
  • 78. • • ≒
  • 79. • • ≒ =0/3=0
  • 80. • • ≒ =0/3=0 =1/3
  • 81. • • ≒ =0/3=0 =1/3 =2/3
  • 82. • • ≒ =0/3=0 =1/3 =2/3 =3/3=1
  • 83. • 1000• summaryMin 1st Que. Median Mean 3rd Que. Max0.00 0.00 0.1157 0.2071 0.2667 1.000
  • 84. • 25 0.08
  • 85. • 14 0.17
  • 86. • 10 0.68
  • 87. • 4 1
  • 88. Visualization Sample
  • 89. • 2hop Social Graph• Edge • ( )• Vertex • ( )• Gephi http://gephi.org/
  • 90. • Social Graph •• GraphDB• Neo4j• R• Visualization
  • 91. Thanks!