Skip to main content

Project: Analyze a Local Interaction Network

This capstone turns the area's contracts into one reproducible local command. It validates the repository-owned interaction fixture, computes explicitly defined summaries, evaluates a small temporal link task, records named errors, and writes byte-stable JSON evidence.

Prerequisites​

Complete fairness, privacy, and harm in networks and the preceding 22 lessons. The project assumes you can distinguish graph data, model choices, evaluation evidence, and deployment claims.

Learning goals​

  • Run a graph analysis from raw local records to a reviewable artifact.
  • Keep graph semantics and defect handling in the evidence.
  • Enforce a temporal feature cutoff and declared candidate policy.
  • Report named errors and limitations without causal language.

Project contract​

  • Inputs: interaction-nodes.csv and interaction-relationships.csv; no graph database, endpoint, hosted model, download, or credential.
  • Validation: preserve ten valid events, one missing record, and two malformed records; valid endpoints must exist and valid weights must be positive.
  • Measures: report node and event counts, unique directed pairs, weak components, and an undirected degree ranking with self-loops excluded from that ranking.
  • Link task: rank three predeclared pairs using pre-cutoff Jaccard overlap; do not convert missing or malformed records into negatives.
  • Evidence: fixed key order, sorted collections, explicit named errors, and limitations; repeated runs must be byte-identical.

Run the capstone​

From the repository root:

npm run project:graph-learning -- --output /tmp/graph-learning-evidence.json

Review the file rather than only the success message. graph_semantics states what nodes and edges mean. data_defects preserves rejected evidence. declared_metrics makes aggregation visible. temporal_link_task records the cutoff, features, candidates, predictions, and precision_at_2. named_errors retains a false positive and a tie-sensitive future link. limitations rejects causal, population, and safety overclaims.

Worked example​

import json
import subprocess
import sys
import tempfile
from pathlib import Path

command = Path("scripts/run-graph-learning-project.py")
with tempfile.TemporaryDirectory() as directory:
first = Path(directory) / "first.json"
second = Path(directory) / "second.json"
for output in (first, second):
subprocess.run([sys.executable, str(command), "--output", str(output)], check=True, capture_output=True)
evidence = json.loads(first.read_text(encoding="utf-8"))
print(f"byte_stable={first.read_bytes() == second.read_bytes()} defect_counts={evidence['data_defects']['counts']}")
print(f"split_rule={evidence['temporal_link_task']['split_rule']} precision_at_2={evidence['temporal_link_task']['precision_at_2']}")
print(f"named_errors={[item['error'] for item in evidence['named_errors']]} causal={evidence['graph_semantics']['causal_interpretation']}")

Expected output:

byte_stable=True defect_counts={'valid': 10, 'missing': 1, 'malformed': 2}
split_rule=observed_at < 2026-10-03T00:00:00Z precision_at_2=0.5
named_errors=['false_positive', 'tie_sensitive_ranking'] causal=False

Reading the result​

The ranking deliberately fails in useful ways. Cy–Eli receives the highest structural score but has no observed future link. Ada–Fox and Ben–Fox are future links with zero overlap and tie under the baseline. Those cases show why metric definitions, deterministic tie-breaking, and qualitative error review belong together.

The artifact does not train an embedding or GNN. Its results are not causal. That is an honest boundary: seven people and ten valid events cannot justify model selection, accelerator use, or generalization claims. A larger project would add train-only preprocessing, validation-based selection, repeated seeds, uncertainty, capacity measurements, slices, and an independent final test.

Limitations​

  • The fixture is synthetic and too small to estimate production quality, fairness, privacy, or scaling.
  • The candidate set is declared for teaching and does not represent retrieval over all nonedges.
  • Observed future edges are incomplete labels; unobserved does not mean negative.
  • Structural association and temporal precedence do not establish causal relationships.

Practice​

Add a new candidate without changing the cutoff. Before running, write its eligibility rule, expected tie behavior, and whether the evidence schema must change. Then confirm two independent output files remain byte-identical.

Next steps​

The 24-lesson Graph & Network Data Science path is complete. Revisit graphs as a data model and explain how every later system, learning objective, and evaluation result depends on that initial observation contract.

Primary sources​

Checked 2026-10-18: NetworkX 3.7, stable reference; D. Liben-Nowell and J. Kleinberg, The Link Prediction Problem for Social Networks; W. L. Hamilton, R. Ying, and J. Leskovec, GraphSAGE; NIST, Privacy Framework.