Tutorials › Multi-Omics Data Integration › Common Errors in Network and Kernel Fusion

Similarity Network Fusion and Kernel Methods · Tutorial 352 of 597

Common Errors in Network and Kernel Fusion

You will learn practical checks and justified corrections for common network and kernel fusion errors, while recognizing when a correction would change the meaning of the analysis.

Advanced 10 min read

What You'll Learn

  • Distinguish the symmetry and nonnegativity requirements of an undirected affinity from the positive-semidefinite requirement of a kernel.
  • Check whether a kernel matrix is positive semidefinite and understand what eigenvalue correction changes.
  • Align matrices by patient identifiers rather than relying on row position.
  • Diagnose how diagonal self-loops alter row-normalized network weights.
  • Compare matrix scales and choose a fusion normalization that matches the analysis goal.
  • Use structural checks and sensitivity analyses to detect fusion failures.

Why Fusion Errors Matter

A fused matrix is only meaningful if its inputs represent the intended patients and similarities. A coding error can make an undirected network asymmetric, turn a purported kernel into a matrix that cannot represent inner products, or pair one patient’s profile in one view with another patient’s profile in a second view. Other errors are less conspicuous: diagonal self-loops can absorb network weight, and a view with numerically larger entries can dominate a fusion even when it is not more informative.

These problems should be checked before interpreting fused clusters or downstream analyses. A correction is not automatically harmless: symmetrizing a deliberately directed network, altering a kernel to make it positive semidefinite, or rescaling an affinity all change what the matrix represents. The appropriate response depends on the matrix’s intended meaning and the fusion method.

Definition: An affinity matrix \(A\) for \(n\) patients records pairwise similarities, with \(A_{ij}\) describing the relationship between patients \(i\) and \(j\). For an undirected similarity network, \(A\) is symmetric and typically has nonnegative entries. A kernel matrix \(K\) is symmetric and positive semidefinite: for every vector \(c\), \(c^\mathsf{T}Kc \geq 0\). A valid kernel matrix can be represented as inner products among feature vectors. These are different requirements: a symmetric, nonnegative affinity matrix need not be a valid kernel.

The checks below assume that each matrix refers to the same intended set of patients, with an explicit and consistent patient identifier. The entries are finite, and any missing-data handling has been decided before constructing or fusing the matrices. For an undirected network, symmetry and the chosen diagonal convention should be documented. For kernel fusion, each input called a kernel must be symmetric and positive semidefinite, subject to a stated numerical tolerance.

Check Symmetry and Diagonal Handling

For an undirected affinity, compare \(A_{ij}\) with \(A_{ji}\), not just the overall appearance of the matrix. Small differences can result from rounding; larger differences can indicate inconsistent calculations or an unintended directional construction. If the scientific object is genuinely directed, asymmetry may be intentional, but it is no longer an undirected affinity and should not be made symmetric without justification.

The diagonal also needs an explicit convention. In a patient similarity network, self-similarity is often excluded from the edges and the diagonal is set to zero. A kernel, in contrast, commonly has nonzero diagonal entries: \(K_{ii}\) is the squared length of the feature vector for patient \(i\). Setting kernel diagonals to zero as if they were network self-loops can invalidate the kernel. Always distinguish a kernel matrix from a graph adjacency or affinity matrix.

Worked Example: Correcting an Undirected Affinity

Suppose three hypothetical patients have an affinity matrix whose rows and columns are in the same patient order, but the calculation has produced unequal entries on opposite sides of the diagonal:

$$ R= \begin{pmatrix} 1 & 0.9 & 0.2\\ 0.5 & 1 & 0.7\\ 0.4 & 0.3 & 1 \end{pmatrix}. $$

Assume the target is an undirected affinity and the diagonal is to be excluded. A simple documented correction is to average each off-diagonal pair, then set the diagonal to zero:

$$ A_{ij}=\frac{R_{ij}+R_{ji}}{2}\quad(i\ne j),\qquad A_{ii}=0. $$

The three off-diagonal averages are \((0.9+0.5)/2=0.7\), \((0.2+0.4)/2=0.3\), and \((0.7+0.3)/2=0.5\). Thus

$$ A= \begin{pmatrix} 0 & 0.7 & 0.3\\ 0.7 & 0 & 0.5\\ 0.3 & 0.5 & 0 \end{pmatrix}. $$

The corrected matrix is symmetric and nonnegative. If row-normalized weights are required, the row sums are \(1.0\), \(1.2\), and \(0.8\); dividing each row by its own sum gives rows \((0,0.7,0.3)\), approximately \((0.583,0,0.417)\), and \((0.375,0.625,0)\). This normalization is appropriate only if the method calls for row-normalized affinities. If the original asymmetry represented a deliberate directed relation, averaging would erase that direction and would not be a valid correction.

A related error is leaving diagonal values in an affinity and then row-normalizing. For example, the row \((1,0.6,0.2)\) becomes \((0.556,0.333,0.111)\) after division by its sum of \(1.8\). More than half of its normalized weight is now assigned to the patient’s self-loop. If the intended graph excludes self-edges, first set the diagonal to zero: the row \((0,0.6,0.2)\) then normalizes to \((0,0.75,0.25)\). In other methods, self-weights may be deliberately retained; the error is not retaining them per se, but doing so unintentionally or inconsistently across views.

Verify That a Kernel Is Actually a Kernel

A symmetric matrix can still fail the positive-semidefinite condition. For a finite matrix, positive semidefiniteness is equivalent to having no negative eigenvalues, apart from small numerical errors. A substantially negative eigenvalue means that some vector \(c\) has \(c^\mathsf{T}Kc<0\), which is incompatible with representing the entries as inner products. The test is about the matrix as a whole; nonnegative entries alone do not establish kernel validity.

Worked Example: Finding and Repairing an Invalid Kernel

Consider this hypothetical symmetric matrix, intended as a kernel for three patients:

$$ K= \begin{pmatrix} 1 & 1.2 & 0\\ 1.2 & 1 & 0\\ 0 & 0 & 1 \end{pmatrix}. $$

The upper-left block has eigenvalues \(1+1.2=2.2\) and \(1-1.2=-0.2\); the remaining eigenvalue is \(1\). Because \(-0.2<0\), \(K\) is not positive semidefinite. It cannot be used as a valid inner-product kernel without a justified correction.

One possible correction is eigenvalue clipping: replace the negative eigenvalue by zero and reconstruct the matrix using the same eigenvectors. The clipped block has eigenvalues \(2.2\) and \(0\), giving

$$ K_+= \begin{pmatrix} 1.1 & 1.1 & 0\\ 1.1 & 1.1 & 0\\ 0 & 0 & 1 \end{pmatrix}. $$

Its eigenvalues are \(2.2\), \(0\), and \(1\), so it is positive semidefinite. This correction changes the original diagonal entries from \(1\) to \(1.1\) for the first two patients. If unit diagonal is required, a further normalization is possible: divide entry \(K_{+,ij}\) by \(\sqrt{K_{+,ii}K_{+,jj}}\). Here that gives off-diagonal value \(1\) for the first pair and leaves the third patient’s diagonal at \(1\); the result is still positive semidefinite. Neither correction recovers an unknowable “true” kernel. The correction rule and its effect should be reported, and the analysis should be checked for sensitivity to the choice.

A useful numerical diagnostic is to compute the smallest eigenvalue \(\lambda_{\min}\) of the symmetrized matrix \((K+K^\mathsf{T})/2\). If \(\lambda_{\min}\) is negative by more than a tolerance appropriate to the matrix scale and numerical precision, investigate the construction before continuing. Symmetrization addresses numerical asymmetry; it does not by itself make a matrix positive semidefinite. Adding \(\delta I\), where \(I\) is the identity matrix, shifts every eigenvalue upward by \(\delta\). It makes a matrix with smallest eigenvalue \(-0.2\) positive semidefinite when \(\delta\geq0.2\), but also changes every diagonal entry. That may be unsuitable if the diagonal has a fixed interpretation.

Align Patients Before Combining Views

Two matrices with the same dimensions do not necessarily refer to patients in the same order. Fusion is a patient-by-patient operation: a row or column in one view must refer to the same patient as the corresponding row or column in every other view. Matching by position without checking identifiers can produce a matrix that is numerically valid but scientifically meaningless.

Worked Example: Reordering a Kernel by Patient Identifier

Suppose one hypothetical view is ordered \(A,B,C\), with kernel

$$ K_{ABC}= \begin{pmatrix} 1 & 0.9 & 0.1\\ 0.9 & 1 & 0.2\\ 0.1 & 0.2 & 1 \end{pmatrix}, $$

while a second view is ordered \(C,A,B\), with

$$ K_{CAB}= \begin{pmatrix} 1 & 0.1 & 0.2\\ 0.1 & 1 & 0.9\\ 0.2 & 0.9 & 1 \end{pmatrix}. $$

The entries are consistent across views, but the matrices cannot be compared entry by entry in their current orders. Reorder the second matrix’s rows and columns to \(A,B,C\), using the identifier mapping \(A\leftarrow2\), \(B\leftarrow3\), \(C\leftarrow1\). The aligned matrix is

$$ K_{ABC}^{(2)}= \begin{pmatrix} 1 & 0.9 & 0.1\\ 0.9 & 1 & 0.2\\ 0.1 & 0.2 & 1 \end{pmatrix}. $$

For example, the \(A,B\) entry is the original second matrix’s row 2, column 3, namely \(0.9\). The alignment uses the same permutation on rows and columns because each entry describes a pair of patients. In general, if a permutation matrix \(P\) maps the new order to the stored order, the reordered matrix is \(P^\mathsf{T}K P\). Check that the patient identifiers are unique, that the same patients are represented, and that any excluded patients are handled consistently before fusion.

Check Matrix Scales Before Fusion

Even correctly aligned and well-formed matrices can have incomparable numerical scales. In a weighted sum, a view with larger entries can dominate the result because of scale rather than because its similarities are more informative. Normalization is one response, but there is no universal normalization that is right for every method: the appropriate choice depends on whether absolute similarity levels, relative patterns, or another quantity is intended to carry meaning.

Worked Example: Diagnosing Unequal Affinity Scales

For three hypothetical patients, consider two symmetric, zero-diagonal affinity matrices:

$$ A= \begin{pmatrix}0&0.8&0.4\\0.8&0&0.2\\0.4&0.2&0\end{pmatrix}, \qquad B= \begin{pmatrix}0&8&1\\8&0&1\\1&1&0\end{pmatrix}. $$

An unnormalized equal-weight average gives off-diagonal entries \((4.4,0.7,0.6)\). The first pair’s fused affinity is \(4.4\), largely because view \(B\) has entries on a much larger scale. The mean off-diagonal values are \(0.4667\) for \(A\) and \(3.333\) for \(B\). As one illustrative scale adjustment, divide each matrix by its mean off-diagonal value. The normalized off-diagonal entries are approximately \((1.714,0.857,0.429)\) for \(A\) and \((2.400,0.300,0.300)\) for \(B\). Their equal-weight average is approximately \((2.057,0.579,0.364)\).

This adjustment makes each view’s mean off-diagonal affinity equal to one, but it does not make the distributions of affinities identical or prove that the views should receive equal scientific importance. It is a transparent choice that should be checked against alternatives, including leaving the scales unchanged when their absolute values are meaningful. For kernels, use a normalization appropriate to kernels and the intended fusion; do not assume that an affinity normalization preserves every kernel property.

Justify the Fusion Operation and Diagnose Failures

A useful structural check follows directly from the kernel definition. If \(K_1,\ldots,K_m\) are positive semidefinite kernels and the weights \(w_v\) are nonnegative, then their weighted sum is also a valid kernel:

$$ c^\mathsf{T}\left(\sum_{v=1}^{m}w_vK_v\right)c =\sum_{v=1}^{m}w_v(c^\mathsf{T}K_vc)\geq0. $$

Each term is nonnegative because \(K_v\) is positive semidefinite and \(w_v\geq0\). Thus the fused matrix is positive semidefinite. This guarantee depends on valid input kernels and nonnegative weights; it does not apply automatically to arbitrary matrices or to sums with negative weights. In contrast, symmetric nonnegative affinities fused by a nonnegative weighted sum remain symmetric and nonnegative, but this alone does not make the result a kernel.

Diagnostics should be applied both before and after fusion. Check dimensions, patient identifiers, symmetry, diagonal conventions, finite values, nonnegativity where required, and kernel eigenvalues where relevant. Inspect row sums after any row normalization and look for isolated patients, unexpectedly concentrated rows, or a view whose entries overwhelm the others. Repeat fusion under plausible normalization and weighting choices. If results change sharply, that is evidence of sensitivity, not a reason to select whichever result looks most appealing.

1
Confirm the object.
Label each input as an affinity, a directed network, or a kernel. Specify intended symmetry, diagonal handling, and any required positive-semidefinite condition.
2
Verify patient alignment.
Match rows and columns by identifiers, then confirm that the same patients appear in each view or document the chosen missing-patient procedure.
3
Check structure and scale.
Inspect asymmetry, diagonals, negative entries, kernel eigenvalues, and scale summaries. Correct only violations that conflict with the intended object.
4
Fuse and reassess.
Use a method whose assumptions match the inputs, then repeat the structural checks and assess sensitivity to defensible correction and normalization choices.

Common Mistakes and Limits

Incorrect reasoningCorrection
“The matrix is symmetric and nonnegative, so it is a valid kernel.”Those properties do not guarantee positive semidefiniteness; check eigenvalues or another valid PSD criterion.
“The matrices have the same dimensions, so their rows refer to the same patients.”Align by patient identifiers and apply the same permutation to rows and columns.
“A diagonal value is always an unwanted self-loop.”That may be true for a graph affinity under a zero-diagonal convention, but kernel diagonals have a different meaning.
“The view with larger entries is more informative.”Scale alone does not establish information or importance. Inspect scale and justify any normalization or weighting.
“Symmetrizing every asymmetric matrix fixes it.”Symmetrization is appropriate only when the target is undirected. It destroys direction when direction is meaningful.

Corrections have limits. Eigenvalue clipping changes a kernel and may alter the geometry it encodes; averaging asymmetric entries can hide a data-construction error; and normalization can remove meaningful absolute differences between views. Diagnostics can flag a mismatch but cannot determine the scientific meaning of a matrix without information about how it was built. Record the original matrix, the correction, the reason for it, and the resulting sensitivity checks.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. What condition distinguishes a valid kernel from a symmetric, nonnegative affinity matrix?
  2. A kernel has a smallest eigenvalue of \(-0.00001\), close to numerical precision relative to its scale. What should be checked before applying a substantive correction?
  3. One view is ordered \(P,Q,R\), another is \(R,P,Q\). What must be reordered before fusion?
  4. Why can an unnormalized average of two affinities over-weight one view?

Solutions. (1) A kernel must be symmetric and positive semidefinite, meaning \(c^\mathsf{T}Kc\geq0\) for every \(c\); symmetry and nonnegativity of entries alone are insufficient. (2) Check numerical precision, matrix scale, and any small asymmetry, and compare the eigenvalue with a documented tolerance. A tiny negative value may be a numerical artifact; a clearly negative value requires investigation and a justified correction. (3) Reorder both rows and columns of the second matrix by patient identifier into the common order \(P,Q,R\). Reordering only one dimension does not preserve pairwise patient relationships. (4) The entries of one view may be numerically larger, causing its contribution to dominate the sum even if the scale difference does not represent greater information. Examine scales and justify a normalization or weighting choice rather than treating raw magnitude as importance.

Clinical Biostats