Tools: Python, NetworkX, PyG (PyTorch Geometric) or scikit-learn.
Refining "Lift":
In a graph context, lift usually implies: "If I target the nodes the algorithm is most confident about, what is the lift in capturing the true positive class compared to random targeting?"
Formula: Lift@k=k×(Total Positives/Total Population)Count of True Positives in top k.
Refining "Confidence":
It's not just a number; it's a filter. We need to see if high confidence correlates with high accuracy.
Structure of the Output:
I will structure this as a formal experimental proposal/design document.
Experiment Overview
Data Strategy (Synthetic & Real-world)
Methodology (Algorithms & Confidence)
Metrics Definition (Deep dive on Lift & Calibration)
Experimental Protocol (The step-by-step runs)
Visualization & Reporting
Self-Correction during drafting:
Make sure to define "Lift" clearly. It can be ambiguous.
Ensure the distinction between Label Propagation (hard clamping) and Label Spreading (soft clamping) is mentioned as it affects confidence.
Include a "Human-in-the-loop" or "Active Learning" angle, as that's usually where Lift matters most.
Let's build the response.
Title: Label Propagation Experiment Suite: Evaluating Efficacy, Confidence, and Lift.
Section 1: Setup.
Section 2: The Variables.
Section 3: The Metrics (Focus on the prompt's requirements).
Section 4: The Experiments (The actual suite).
Section 5: Analysis Framework.
(Self-Correction: Add code snippets? No, the prompt asks to "Design a suite," which implies the architecture/plan, but pseudocode or logic flow helps. I will stick to a structured design document format.)
Lift Detail: Explain Cumulative Lift.
Confidence Detail: Explain Entropy vs. Probability.
Final polish of the structure. Looks solid.
This design outlines a comprehensive experiment suite for evaluating Label Propagation (LP) algorithms. It focuses not just on raw accuracy, but on the reliability of the propagation (confidence) and the business value of the predictions (lift).
1. Experiment Objective
The goal is to simulate a semi-supervised learning environment where a small set of seeded (labeled) nodes is used to classify a large graph. We aim to determine:
Accuracy: How well do different LP methods recover ground truth?
Confidence: Is the algorithm's probability output calibrated?
Lift: If we only target the top X% of predictions, how much better is that than random guessing?
2. Data Strategy
To ensure robustness, the suite must run across three data categories:
A. Synthetic Data (Controlled Topology)
Stochastic Block Model (SBM): Generate graphs with known communities (ground truth). Vary the p (intra-cluster probability) and q (inter-cluster probability) to test robustness to noise.
Coauthorship Networks: Dense connections, high homophily.
C. Feature Engineering
For Lift analysis, you need a "value" associated with nodes (e.g., potential revenue, fraud risk score). If not in the dataset, synthesize this attribute based on the cluster structure.
3. Algorithms (The "Methods")
We compare classical and modern approaches:
Baselines:
Random: Assign labels based on global class distribution.
Majority Vote: Assign label based on immediate neighbors.
Standard LP: Zhu & Ghahramani (probabilistic, clamping hard labels).
Label Spreading: Zhou et al. (uses a normalized graph Laplacian, allows input labels to change based on graph structure—robust to noise).
Graph Neural Networks (Optional): GCN or GraphSAGE (to compare LP against deep learning).
4. Metrics Framework
This is the core of the suite.
A. Standard Performance
Micro/Macro F1-Score: Standard classification metrics.
Edge Homophily: Ratio of edges connecting nodes of the same class (context for results).
B. Confidence Scoring
Since LP works by distributing probability mass, we evaluate the quality of that probability.
Entropy:H(x)=−∑p(x)logp(x). Low entropy = high confidence.
Calibration (ECE - Expected Calibration Error): Measures if a prediction with 80% confidence is correct 80% of the time.
Hypothesis: LP often acts as a smoothing filter and may be over-confident in wrong regions.
C. Lift Analysis
Lift measures the improvement over a random model. It is crucial for resource-constrained scenarios (e.g., "Who do we show this ad to?" or "Which account do we investigate for fraud?").
Lift Formula:Lift@k=Base RatePrecision@kWhere Base Rate is the % of positive samples in the total population.
Lift Curve: Plot the cumulative % of positive targets captured vs. the % of population predicted (similar to a Gains Chart).
5. Experimental Protocol
Setup
Split Strategy: Use a "Mask" approach.
Labeled Set: 1% to 20% of nodes.
Unlabeled Set: The rest.
Test Set: The unlabeled set (since we hide the labels).
Iterations: Run LP until convergence (change in label distribution < ϵ) or max iterations (e.g., 30).
Experiment 1: The Sparsity Stress Test
Variable: Labeled Data % (0.5%, 1%, 2%, 5%, 10%).
Goal: Determine how much labeled data is required for the model to "kick in."
Metric: F1-Score vs. Label %.
Experiment 2: The Confidence-Calibration Audit
Method: Run Label Spreading.
Analysis: Bin predictions by confidence score (0.0-0.1, ..., 0.9-1.0).
Plot: Reliability Diagram. Plot Observed Accuracy vs. Predicted Confidence.
Goal: Identify if high-confidence predictions in LP are trustworthy.
Experiment 3: The Lift@K Evaluation
Scenario: We can only target the top 10% of nodes.
Process:
Run LP.
Rank nodes by predicted probability of the "Target Class" (e.g., Class 1).
Calculate Lift at Top 10%, 20%, 30%.
Comparison: Compare LP Lift against a Random Classifier and a Pure Feature-Based Classifier (ignoring the graph).
Experiment 4: Sensitivity to Homophily (Noise)
Data: Use SBM to generate graphs.
Variable: Inter-cluster edge probability (q). Increase q to lower homophily (make the graph "messier").
Goal: At what noise level does LP perform worse than the baseline? (LP assumes homophily; if edges are random, LP fails).
6. Visualization & Reporting Dashboard
The output of the suite should generate the following plots:
Accuracy vs. Label Rate: A line chart comparing Standard LP, Label Spreading, and Baselines across different labeled data percentages.
Confidence Histogram: A distribution of the max-soft-label probability. (Is the model usually "sure" or "unsure"?)
Lift Curve (The "Business" Chart):
X-axis: % of Population Sampled (sorted by confidence).
Y-axis: % of Total Positives Captured.
Reference lines: Random Model, Perfect Model.
t-SNE/UMAP Plot: Visualizing the graph in 2D, coloring nodes by:
Ground Truth
Predicted Label
Confidence (Gradient color: Bright = High Conf, Dim = Low Conf).
7. Implementation Stack (Python)
Graph Handling:NetworkX or PyG (PyTorch Geometric).
def run_experiment_suite(graph, ground_truth, label_rates=[0.01, 0.05, 0.1]):
results = []
for rate in label_rates:
# 1. Mask labels (Hide 1-rate% of labels)
masked_labels = create_mask(ground_truth, mask_rate=1-rate)
# 2. Run Methods
for method in ['label_propagation', 'label_spreading']:
model = get_model(method)
model.fit(graph.adjacency_matrix, masked_labels)
# 3. Get Predictions & Probabilities
predictions = model.predict(unlabeled_indices)
probabilities = model.predict_proba(unlabeled_indices)
# 4. Calculate Metrics
f1 = f1_score(ground_truth[unlabeled], predictions)
lift_at_10 = calculate_lift(ground_truth[unlabeled], probabilities, k=0.1)
calibration_error = calculate_ece(ground_truth[unlabeled], probabilities)
results.append({
'method': method,
'label_rate': rate,
'f1': f1,
'lift@10': lift_at_10,
'calibration': calibration_error
})
return pd.DataFrame(results)
PrecisionLP
Context: If I select the top K nodes based on LP confidence, how much better is that than randomly selecting K nodes? This is crucial for "active learning" or "targeting" scenarios.