Skip to content

Latest commit

 

History

History
74 lines (55 loc) · 3.25 KB

README.md

File metadata and controls

74 lines (55 loc) · 3.25 KB

Node-Link-Diagram

Project Structure

Dataset Description

This dataset represents a network of politicians speaking in the United States Congress. Nodes are politicians, and directed edges denote one politician mentioning another. Edge weights represent whether the mention is in support (positive weight) or opposition (negative weight). Parallel edges and self-loops are allowed.

Data Analysis and Preprocessing

  1. Loading Data:

    • Load the dataset from data.convote.
    • Extract tuples of (Source, Target, Weight).
  2. Separating Positive and Negative Edges:

    • Create separate DataFrames for positive and negative edges.
  3. Grouping and Summing:

    • Group positive edges by source and target nodes, summing weights.
    • Group negative edges similarly, negating the weights.
  4. CSV Export:

    • Export positive and negative edge DataFrames to CSV files.
    • Export node information to a CSV file.
  5. Creating Node-Link Diagrams:

    • Two node-link diagrams are created to visually represent the network based on the nature of interactions between politicians.
      • Positive Edges Diagram:
        • Represents instances where a speaker is mentioned in support of another.
        • Positive edge weight implies support.
      • Negative Edges Diagram:
        • Represents instances where a speaker is mentioned in opposition to another.
        • Negative edge weight implies opposition.

Importing Graph Files to Gephi

  1. Install Gephi:

  2. Importing Positive Edges:

    • Open Gephi.
    • File > Open Project > Select positive_edges.gephi.
    • Explore and visualize positive edges using various layout algorithms.
  3. Importing Negative Edges:

    • Open Gephi.
    • File > Open Project > Select negative_edges.gephi.
    • Explore and visualize negative edges using various layout algorithms.

Feel free to explore different layout algorithms in Gephi to understand the network structure better.