Projection की अवधारणा

इंटरमीडिएट Network Analysis in Python

Eric Ma

Data Carpentry instructor and author of nxviz package

Projection

  • एक पार्टिशन के नोड्स के बीच संबंध जाँचने में उपयोगी
    • दूसरे पार्टिशन के नोड्स से कनेक्शनों पर कंडीशन किया गया
इंटरमीडिएट Network Analysis in Python

Projection

  • Bipartite कनेक्टिविटी का unipartite प्रतिनिधित्व

ch2-1.006.png

इंटरमीडिएट Network Analysis in Python

Projection

  • Bipartite कनेक्टिविटी का unipartite प्रतिनिधित्व

ch2-1.007.png

इंटरमीडिएट Network Analysis in Python

Projection

  • Bipartite कनेक्टिविटी का unipartite प्रतिनिधित्व

ch2-1.008.png

इंटरमीडिएट Network Analysis in Python

Projection

  • Bipartite कनेक्टिविटी का unipartite प्रतिनिधित्व

ch2-1.009.png

इंटरमीडिएट Network Analysis in Python

डिस्क पर ग्राफ

  • Flat edge lists
  • CSV फाइलें: nodelist + metadata, edgelist + metadata
इंटरमीडिएट Network Analysis in Python

नेटवर्क डेटा पढ़ना

import networkx as nx
G = nx.read_edgelist('american-revolution.txt')

list(G.edges(data=True))[0:5]
[('Parkman.Elias', 'LondonEnemies', {'weight': 1}),
 ('Parkman.Elias', 'NorthCaucus', {'weight': 1}),
 ('Inglish.Alexander', 'StAndrewsLodge', {'weight': 1}),
 ('NorthCaucus', 'Chadwell.Mr', {'weight': 1}),
 ('NorthCaucus', 'Pearce.IsaacJun', {'weight': 1})]
  • टेक्स्ट फाइल
    Barrett.Samuel LondonEnemies {'weight': 1}
    Barrett.Samuel StAndrewsLodge {'weight': 1}
    Marshall.Thomas LondonEnemies {'weight': 1}
    Eaton.Joseph TeaParty {'weight': 1}
    Bass.Henry LondonEnemies {'weight': 1}
    
इंटरमीडिएट Network Analysis in Python

Bipartite projection

list(G.nodes())
['product2', 'customer3', 'customer1', 'product3',  
    'customer2', 'product1']
list(G.edges())
[('product2', 'customer1'),
 ('product2', 'customer2'),
 ('customer3', 'product1')]
इंटरमीडिएट Network Analysis in Python

Bipartite projection

cust_nodes = [n for n in G.nodes() if G.nodes[n]
                  ['bipartite'] == 'customers']
cust_nodes
['customer3', 'customer1', 'customer2']
इंटरमीडिएट Network Analysis in Python

Bipartite projection

G_cust = nx.bipartite.projected_graph(G, cust_nodes)
list(G_cust.nodes())
['customer1', 'customer3', 'customer2']
list(G_cust.edges())
[('customer1', 'customer2')]
इंटरमीडिएट Network Analysis in Python

Degree centrality

  • डिग्री सेंट्रैलिटी की परिभाषा याद करें $$\frac{\text{number of neighbors}}{\text{number of possible neighbors}}$$
  • हर: विपरीत पार्टिशन के नोड्स की संख्या
इंटरमीडिएट Network Analysis in Python

Bipartite degree centrality

nx.bipartite.degree_centrality(G, cust_nodes)
{'customer1': 0.3333333333333333,
 'customer2': 0.3333333333333333,
 'customer3': 0.3333333333333333,
 'product1': 0.3333333333333333,
 'product2': 0.6666666666666666,
 'product3': 0.0}
इंटरमीडिएट Network Analysis in Python

Bipartite degree centrality

nx.degree_centrality(G)
{'customer1': 0.2,
 'customer2': 0.2,
 'customer3': 0.2,
 'product1': 0.2,
 'product2': 0.4,
 'product3': 0.0}
इंटरमीडिएट Network Analysis in Python

अभ्यास करते हैं!

इंटरमीडिएट Network Analysis in Python

Preparing Video For Download...