torch_geometric.nn.aggr.MedianAggregation
- class MedianAggregation(fill_value: float = 0.0)[source]
-
一个聚合操作符,返回一组数据的特征中位数。
That is, for every feature \(d\), it computes
\[{\mathrm{median}(\mathcal{X})}_d = x_{\pi_i,d}\]其中 \(x_{\pi_1,d} \le x_{\pi_2,d} \le \dots \le x_{\pi_n,d}\) 并且 \(i = \lfloor \frac{n}{2} \rfloor\).
注意
如果中位数位于两个值之间,则返回较低的那个值。 要计算这两个值的中点(或其他类型的插值),请使用
QuantileAggregation代替。- Parameters:
fill_value (float, optional) – The default value in the case no entry is found for a given index (default:
0.0).