Organizations: Dipartimento di Informatica, Universit`a di Pisa, Largo Bruno Pontecorvo 3, Pisa, 56127, Italy. · Istituto di Scienza e Tecnologie dell’Informazione, Consiglio Nazionale delle Ricerche, Via Giuseppe Moruzzi 1, Pisa, 56124, Italy.
Graph node quantification is the supervised learning task of estimating the prevalence of different classes within an arbitrary sample of unlabelled nodes from a graph, subject to some form of dataset shift. Existing approaches to graph node quantification typically follow the standard aggregative paradigm, i.e., they use labelled nodes from the graph to train an intermediate node classifier, and obtain an estimated class distribution for the sample by aggregating the classifier's predictions for the individual nodes and then correcting the result via some adjustment strategy that accounts for dataset shift. In this work we propose a framework for graph node quantification that does away with both node-level supervision, since its training phase only requires node samples labelled by their class distribution, and node-level predictions, since it estimates class prevalence values directly, without the need of any intermediate node classifier. The framework thus allows symmetric quantification, since (unlike in standard ``asymmetric'' quantification methods) the labelled items used for training and the unlabelled items on which predictions must be issued are of the same type (i.e., node samples). This framework (that we dub GSQ, for Graph Node Symmetric Quantification) allows building pipelines consisting of a node encoder, an embedding pooler, a prevalence predictor, and an optional post-hoc scaling step. These components can be instantiated by choosing from different trainable and reservoir-based encoders, different pooling operators, and different prediction objectives. We evaluate the GSQ framework on binary and multi-class datasets with different levels of homophily, under prior probability shift and under structural covariate shift.
Figures & tables
Figure 1: Inference with a trained aggregative node quantification pipeline. The encoder maps the input graph to node embeddings, using which a classifier is first trained from labelled nodes and then applied to issue predictions for the unlabelled nodes. For a query sample σ⊆VU , the aggregative quantifier aggregates the corresponding predictions and corrects for dataset shift to produce a class-prevalence estimate. The shaded regions distinguish graph-level from sample-level inference.
Figure 2: Inference with GSQ, our proposed graph node symmetric quantification framework. The encoder computes node embeddings, after which, given a query sample σ⊆VU , the embeddings of the nodes contained in σ are pooled into a sample representation and mapped directly to a class-prevalence estimate, which may optionally undergo post-hoc scaling. The shaded regions distinguish graph-level from sample-level inference.
Statistics
Binary
multi-class
Cora-2
Toloker
Cora
Amazon
# of Nodes
2,708
11,758
2,708
24,492
# of Edges
5,278
519,000
5,278
93,050
# of Features
1,433
10
1,433
300
# of Classes ∣Y∣
2
2
7
5
Average degree dˉ
3.90
88.28
3.90
7.60
Table 1: Dataset characteristics. Edges are unique undirected pairs, dˉ is the average degree, and pmin and pmax are the smallest and largest full-graph class prevalences. Homophily is computed using the labels of each task. Cora-2 and Cora share the same graph and features.
Figure 3: The three sampling protocols considered in this study. Node colour denotes class membership, outlined nodes belong to the sample, and the inner black circle identifies a seed node. (a) APP samples eligible nodes with replacement to realise a prescribed class prevalence, independently of graph locality. (b) BFP runs a breadth-first traversal of the complete graph from a seed node (here, up to three hops), but adds only eligible visited nodes to the sample. Consequently, closer non-outlined nodes may be traversed without being included. (c) RWP performs a stochastic crawl from a seed and adds each eligible visited node at most once. APP therefore isolates controlled prevalence shift, whereas BFP and RWP induce prevalence variation through structural sampling.
Figure 4: Test performance of the validation-selected aggregative and symmetric configurations under the three sampling protocols considered in this study. For each dataset, sampling protocol, and method family, the configuration with the best mean validation AE (lower is better) was selected independently. Bars report its mean test AE across the five folds, and error bars indicate one standard deviation.
Figure 5: Pairwise comparison of the GSQ framework components under PPS sampling. Marker position indicates which method achieves lower validation AE in a larger proportion of matched configurations, while labels report the corresponding win rate. The dashed central line denotes parity. Results are reported separately for the higher-homophily Cora-2 and Cora graphs (blue marker) and the lower-homophily Toloker and Amazon graphs (green marker).
Figure 6: Pairwise comparison of the GSQ framework components under BFP sampling. Marker position indicates which method achieves lower validation AE in a larger proportion of matched configurations, while labels report the corresponding win rate. The dashed central line denotes parity. Results are reported separately for the higher-homophily Cora-2 and Cora graphs (blue marker) and the lower-homophily Toloker and Amazon graphs (green marker).
Figure 7: Pairwise comparison of the GSQ framework components under RWP sampling. Marker position indicates which method achieves lower validation AE in a larger proportion of matched configurations, while labels report the corresponding win rate. The dashed central line denotes parity. Results are reported separately for the higher-homophily Cora-2 and Cora graphs (blue marker) and the lower-homophily Toloker and Amazon graphs (green marker).
Protocol
None
Scalar
Vector
Δ AE
APP
8/20
6/20
6/20
−.0020
BFP
13/20
5/20
2/20
−.0007
RWP
15/20
2/20
3/20
−.0001
Table 2: Post-hoc prevalence scaling selected for the final symmetric models. Counts indicate the number of dataset–fold combinations in which each alternative achieves the lowest validation AE. The final column reports the mean paired difference between the selected and unscaled validation AE, with negative values favouring scaling.
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
Parameter
Values
XNQ
GESN
Reservoir dimension dh
{1024,2048}
Input scale αin
{0.1,0.5,1}
Recurrent scale αrec
{1,10,100}
Iteration setting
30
Node classifier
Mapping
Linear dh→C , followed by softmax
Appendix
Table 3: Aggregative model configurations. Sets denote search grids; other settings are fixed. Here, d is the number of node features, dh is the embedding dimension, and C=∣Y∣ . Shared training settings follow Table 4 .
Parameter
Values
Node encoders
MLP / GCN
Hidden dimension dh ; depth L
{64,128} ; {2,3}
Input projection
Linear d→dh , followed by ReLU
Hidden-layer processing
LayerNorm, ReLU, dropout 0.1
GESN
Iterations
30
Reservoir dimension
{1024,2048}
Appendix
Table 4: Non-aggregative framework configurations. Sets denote search grids; other settings are fixed. Here, d is the number of node features and C=∣Y∣ . The embedding dimension dh is kept fixed during layer processing.
Encoder
Pooler / method
Head
Cora-2
Toloker
Cora
Amazon
Aggregative
XNQ
–
.011 (.005)
.028 (.004)
.011 (.002)
.101 (.046)
APPNP-KDEy
–
.012 (.009)
.046 (.006)
.013 (.003)
.153 (.028)
MLP
Mean
Softmax
.039 (.007)
.050 (.004)
.035 (.001)
.083 (.006)
Dirichlet
.041 (.011)
.054 (.008)
.028 (.003)
.077 (.012)
DeepSets
Softmax
.040 (.016)
.042 (.007)
.026 (.002)
.116 (.006)
Dirichlet
.038 (.011)
.044 (.009)
.026 (.002)
.109 (.006)
Appendix
Table 5: Test absolute error under the APP sampling protocol. Entries report mean AE (standard deviation) across the five folds. Entries in boldface identify the aggregative and symmetric configurations selected independently by lowest mean validation AE.
Figure 8: Diagonal plots under PPS for the binary datasets. Each panel compares the validation-selected aggregative and symmetric configurations. Curves report the mean estimated positive-class prevalence at each true prevalence, while shaded regions denote one standard deviation. For GESN–DeepSets–Dirichlet, the reservoir embeddings are PCA-projected before pooling.
Encoder
Pooler / method
Head
Cora-2
Toloker
Cora
Amazon
Aggregative
XNQ
–
.047 (.032)
.400 (.028)
.030 (.004)
.130 (.011)
APPNP-KDEy
–
.029 (.017)
.262 (.017)
.026 (.003)
.195 (.024)
MLP
Mean
Softmax
.070 (.023)
.045 (.009)
.042 (.003)
.040 (.003)
Dirichlet
.088 (.035)
.046 (.006)
.035 (.007)
.043 (.003)
DeepSets
Softmax
.049 (.024)
.045 (.011)
.040 (.001)
.041 (.003)
Dirichlet
.051 (.017)
.045 (.008)
.048 (.005)
.041 (.003)
Appendix
Table 6: Test absolute error under the BFP sampling protocol. Entries report mean AE (standard deviation) across the five folds. Entries in boldface identify the aggregative and symmetric configurations selected independently by lowest mean validation AE.
Encoder
Pooler / method
Head
Cora-2
Toloker
Cora
Amazon
Aggregative
XNQ
–
.024 (.024)
.222 (.022)
.027 (.006)
.156 (.010)
APPNP-KDEy
–
.014 (.002)
.212 (.022)
.022 (.002)
.202 (.024)
MLP
Mean
Softmax
.040 (.010)
.036 (.001)
.034 (.003)
.051 (.004)
Dirichlet
.028 (.012)
.039 (.003)
.031 (.002)
.054 (.004)
DeepSets
Softmax
.031 (.010)
.036 (.002)
.033 (.004)
.050 (.004)
Dirichlet
.025 (.005)
.038 (.003)
.043 (.006)
.054 (.005)
Appendix
Table 7: Test absolute error under the RWP sampling protocol. Entries report mean AE (standard deviation) across the five folds. Entries in boldface identify the aggregative and symmetric configurations selected independently by lowest mean validation AE.
Protocol
Dataset
Selected configuration
None
Scalar
Vector
ΔAE
APP
Cora-2
GCN–GMNet–Dirichlet
3/5
1/5
1/5
-.0001 (.0001)
Toloker
GESN–DeepSets–Dirichlet
1/5
4/5
0/5
-.0019 (.0014)
Cora
GCN–GMNet–Dirichlet
2/5
1/5
2/5
-.0024 (.0034)
Amazon
GESN–GMNet–Dirichlet
2/5
0/5
3/5
-.0037 (.0045)
BFP
Cora-2
GCN–DeepSets–Dirichlet
2/5
1/5
2/5
-.0021 (.0030)
Toloker
GESN–GMNet–Dirichlet
3/5
2/5
0/5
-.0005 (.0008)
Appendix
Table 8: Post-hoc prevalence scaling selected for the final symmetric configurations. Selection counts indicate the number of folds in which each alternative achieves the lowest validation AE. Boldface identifies the most frequently selected alternative for each dataset. The final column reports mean paired Δ AE (standard deviation) across the five folds, computed as selected minus unscaled validation AE; negative values favour scaling.
Istituto di Scienza e Tecnologie dell’Informazione Consiglio Nazionale delle Ricerche Pisa, Italy · Artificial Intelligence Center University of Oviedo Asturias, Spain