introduction to networks
play

Introduction to networks Network Analysis in Python I Networks! - PowerPoint PPT Presentation

NETWORK ANALYSIS IN PYTHON I Introduction to networks Network Analysis in Python I Networks! Examples: Social Transportation Model relationships between entities Network Analysis in Python I Networks! Insights:


  1. NETWORK ANALYSIS IN PYTHON I Introduction to networks

  2. Network Analysis in Python I Networks! ● Examples: ● Social ● Transportation ● Model relationships between entities

  3. Network Analysis in Python I Networks! ● Insights: ● Important entities: influencers in social network ● Pathfinding: most e ffi cient transport path ● Clustering: finding communities

  4. Network Analysis in Python I Network structure Node Edge Graph Node

  5. Network Analysis in Python I Network structure Friendship: Hugo: date: 2016-05-21 id : 1, age : 34 Eric: id : 2, age : 29 Social Graph

  6. Network Analysis in Python I NetworkX API basics In [1]: import networkx as nx In [2]: G = nx.Graph() In [4]: G.add_nodes_from([1, 2, 3]) In [5]: G.nodes() Out[5]: [1, 2, 3] In [6]: G.add_edge(1, 2) In [7]: G.edges() Out[7]: [(1, 2)]

  7. Network Analysis in Python I NetworkX API basics In [8]: G.node[1]['label'] = 'blue' In [9]: G.nodes(data=True) Out[9]: [(1, {'label': 'blue'}), (2, {}), (3, {})]

  8. Network Analysis in Python I NetworkX API basics In [10]: nx.draw(G) In [11]: import matplotlib.pyplot as plt In [12]: plt.show()

  9. NETWORK ANALYSIS IN PYTHON I Let’s practice!

  10. NETWORK ANALYSIS IN PYTHON Types of graphs

  11. Network Analysis in Python I Undirected graphs ● Facebook social graph

  12. Network Analysis in Python I Undirected graphs In [1]: import networkx as nx In [2]: G = nx.Graph() In [3]: type(G) Out[3]: networkx.classes.graph.Graph

  13. Network Analysis in Python I Directed graphs ● Directed: Twi � er social graph

  14. Network Analysis in Python I Directed graphs In [4]: D = nx.DiGraph() In [5]: type(D) Out[5]: networkx.classes.digraph.DiGraph

  15. Network Analysis in Python I Types of graphs ● Multi(Di)Graph: Trip records between bike sharing stations

  16. Network Analysis in Python I Multi-edge (Directed) graphs In [6]: M = nx.MultiGraph() In [7]: type(M) Out[7]: networkx.classes.multigraph.MultiGraph In [8]: MD = nx.MultiDiGraph() In [9]: type(MD) Out[9]: networkx.classes.multidigraph.MultiDiGraph

  17. Network Analysis in Python I Weights on graphs ● Edges can contain weights 3

  18. Network Analysis in Python I Self-loops ● Nodes that are connected to themselves

  19. NETWORK ANALYSIS IN PYTHON I Let’s practice!

  20. NETWORK ANALYSIS IN PYTHON I Network visualization

  21. Network Analysis in Python I Irrational vs. Rational visualizations

  22. Network Analysis in Python I Visualizing networks ● Matrix plots ● Arc plots ● Circos plots

  23. Network Analysis in Python I Visualizing networks ● Matrix plots ● Arc plots ● Circos plots

  24. Network Analysis in Python I Matrix plot A B C A B B A C C

  25. Network Analysis in Python I Matrix plot A B C A B B A C C

  26. Network Analysis in Python I Matrix plot A B C A B B A C C

  27. Network Analysis in Python I Matrix plot A B C A B B A C C

  28. Network Analysis in Python I Directed matrices A B C A B B A C C

  29. Network Analysis in Python I Visualizing networks ● Matrix Plots ● Arc Plots ● Circos Plots

  30. Network Analysis in Python I Arc plot B A A B C C ordered axis

  31. Network Analysis in Python I Visualizing networks ● Matrix Plots ● Arc Plots ● Circos Plots

  32. Network Analysis in Python I Circos plot A A F F B B D E E C C D

  33. Network Analysis in Python I nxviz API In [1]: import nxviz as nv In [2]: import matplotlib.pyplot as plt In [3]: ap = nv.ArcPlot(G) In [4]: ap.draw() In [5]: plt.show()

  34. NETWORK ANALYSIS IN PYTHON I Let’s practice!

Recommend


More recommend