CelLink.utils.graph_smoothing
- CelLink.utils.graph_smoothing(arr, edges, wt)[source]
Adjust node features towards the weighted average of their neighbors’ features.
- Parameters:
arr (np.array) – Data matrix with shape (n_samples, n_features), where each row corresponds to a node.
edges (list of lists) –
- Contains two or three elements:
edges[0] : list or array of source node indices edges[1] : list or array of target node indices edges[2] : (optional) list or array of weights corresponding to each edge
wt (float) – Weight factor for combining original node features with the smoothed features.
- Returns:
np.array – Smoothed data matrix of the same shape as ‘arr’.