---
title: K-Nearest Hyperplanes Model
url: https://www.emergentmind.com/topics/k-nearest-hyperplanes-knh-model
type: topic
---

# K-Nearest Hyperplanes Model

The K-Nearest Hyperplanes (KNH) model is a generalization of classic graph-based learning frameworks, in which each node is represented not by a datapoint but by an $m$-dimensional Euclidean subspace—an affine “m-flat” or hyperplane. KNH enables multi-view modeling of entities, constructing graphs whose nodes encode higher-order structures across heterogeneous feature sets. Key applications include misinformation detection, where empirical results demonstrate quantitative gains over traditional K-Nearest Neighbors (K-NN) approaches [2102.07857].

## 1. Nodes as m-Flats in Euclidean Space

Whereas the classic K-NN graph defines each node as a point $x_i \in \mathbb{R}^d$, KNH represents each entity $i$ by an $m$-dimensional affine subspace (“flat” or hyperplane) $F_i \subset \mathbb{R}^d$:
$$
F_i = \{\, x \in \mathbb{R}^d : x = U_i \alpha + c_i,\ \alpha \in \mathbb{R}^m\,\}
$$
Here, $U_i \in \mathbb{R}^{d \times m}$ contains orthonormal columns spanning the subspace, and $c_i \in \mathbb{R}^d$ is an anchor point (e.g., the centroid of projected views). When $m = 0$, the construction reduces to classic node-as-point K-NN. For $m = d-1$, each node corresponds to a hyperplane in $\mathbb{R}^d$. This representation is particularly well-suited to settings with multiple “views” or feature groups per entity.

## 2. Subspace Distance Metrics

KNH replaces standard Euclidean pointwise distances with measures of dissimilarity between affine subspaces. Two principal metrics are employed:

- **Projection Distance:** For $U_i$, $U_j$ with anchors $c_i$, $c_j$ and projectors $\Pi_i = U_i U_i^\top$,
  $$
  d_p(F_i, F_j) = \frac{1}{2} \big(
    \| (I - \Pi_i)(c_j - c_i) \|_2 +
    \| (I - \Pi_j)(c_i - c_j) \|_2
  \big)
  $$
  This metric captures both orientation and relative translation. It is the preferred measure in KNH for heterogeneous, multi-view data.

- **Grassmannian (Subspace-Angle) Distance:** Let $\theta_1,\dots,\theta_m$ be principal angles between $\operatorname{span}(U_i)$ and $\operatorname{span}(U_j)$ via $U_i^\top U_j$,
  $$
  d_G(F_i, F_j) = \left( \sum_{k=1}^m \theta_k^2 \right)^{1/2} = \| \arccos\, \operatorname{diag}(\Sigma(U_i^\top U_j)) \|_F
  $$
  This metric focuses solely on relative orientation in Grassmannian manifolds.

## 3. Construction of the KNH Graph

Given multi-view-fused hyperplanes $(U_i, c_i)$ for $i=1,\dots,N$, a weighted undirected graph is constructed based on $K$-nearest-neighbor relations using the chosen subspace distance. The adjacency matrix $A \in \mathbb{R}^{N \times N}$ is built as follows:

1. Compute the pairwise distance matrix $D_{ij} = d(F_i, F_j)$.
2. For each node $i$, select $\mathcal{N}_i$ as the indices of the $K$ smallest nonzero $D_{ij}$.
3. Set edge weight $A_{ij} = \exp(-D_{ij}^2/\sigma^2)$ for $j \in \mathcal{N}_i$ and $A_{ij} = 0$ otherwise; kernel choice may vary.
4. Symmetrize the adjacency: $A \leftarrow (A + A^\top) / 2$.
5. Optionally row-normalize $A$.

This construction collapses to the standard K-NN graph when $m=0$, making KNH a strict generalization.

## 4. Multi-View Data Fusion and Subspace Estimation

KNH is inherently designed to harness multi-view data, where each entity is described by $M$ distinct feature sets or modalities. Let $X^{(m)} \in \mathbb{R}^{N \times d_m}$ denote the $m$-th view for all $N$ entities. The goal is a common $R$-dimensional latent structure across views, achievable via Tensor Canonical Correlation Analysis (TCCA):

- Compute an order-$M$ covariance tensor from the $M$ view matrices.
- Solve the TCCA minimization via rank-$R$ CP decomposition:
  $$
  \min_{h_1, ..., h_M} \frac{1}{2M(M-1)} \sum_{p<q} \|X^{(p)} h_p - X^{(q)} h_q\|^2
  $$
- For each entity $i$, concatenate projected vectors $z_i^{(m)} \in \mathbb{R}^R$ from each view:
  $$
  U_i = [z_i^{(1)}, \dots, z_i^{(M)}],\quad c_i = \frac{1}{M} \sum_{m=1}^M z_i^{(m)}
  $$
- Orthonormalize $U_i$ (e.g., via SVD or QR).

The result is one $m$-flat per node capturing correlations and complementarities across views.

## 5. Application to Misinformation Detection

The KNH adjacency matrix $A$ is used as input to graph-based semi-supervised classifiers. Two principal approaches are highlighted:

- **Graph Convolutional Networks (GCN):** Nodes are featurized by $c_i$ or other metadata. Layer-wise propagation uses the normalized adjacency:
  $$
  H^{\ell+1} = \sigma(\tilde{A} H^\ell W^\ell)
  $$
  with softmax and cross-entropy loss on labeled nodes.

- **Belief-Propagation-Style Diffusion:** Initialize label vector $y \in \{+1,-1,0\}^N$ for real/fake/unknown, iterate
  $$
  f \leftarrow \alpha A f + (1-\alpha) y
  $$
  until convergence, then threshold $f_i$ to assign labels. In experiments, 40% labels are fixed, the remainder predicted.

On real-world datasets, including Twitter (with features such as word-cooccurrence tensors and HTML-tag matrices) and FakeNewsNet/PolitiFact (user-news and publisher-news feature matrices), this procedure yielded consistently enhanced classification metrics for KNH over standard K-NN [2102.07857].

## 6. Theoretical Properties and Computational Complexity

- **Reduction to K-NN:** KNH generalizes K-NN, reducing exactly to classic K-NN when each flat is $m=0$ and Euclidean distances are used.
- **Complexity:**
  - TCCA/CP decomposition: $O(t r \prod d_m)$ for $t$ ALS iterations and rank $r = R$; practically independent of $N$ (excluding tensor formation).
  - Orthonormalization: $O(N R M^2)$ overall.
  - Pairwise distances: $O(N^2 R M)$.
  - $K$-nearest selection: $O(N^2 \log K)$ (or $O(N^2)$ with selection algorithms).
- **Scalability:** Overall complexity is $O(N^2 \cdot \operatorname{poly}(R, M))$, on par with exact K-NN graph construction, aside from multi-view fusion costs.

## 7. Empirical Evaluation and Comparative Performance

Empirical evaluation on semi-supervised fake-news classification demonstrated the following comparative metrics (10 random splits, 40% label rate):

| Dataset            | Method         | Precision | Recall | F1    | Accuracy |
|--------------------|---------------|-----------|--------|-------|----------|
| Twitter (R=20,K=15)| KNN (plain)   | 0.687     | 0.683  | 0.684 | 0.694    |
|                    | KNN+CCA       | 0.691     | 0.682  | 0.686 | 0.697    |
|                    | KNH           | 0.709     | 0.720  | 0.713 | 0.719    |
| FakeNewsNet (R=30,K=20)| KNN      | 0.836     | 0.742  | 0.789 | 0.780    |
|                    | KNN+CCA       | 0.833     | 0.747  | 0.787 | 0.777    |
|                    | KNH           | 0.875     | 0.808  | 0.839 | 0.830    |

Increasing the “flat” dimension $R$ and neighborhood size $K$ further amplifies KNH’s advantage, suggesting subspace-based nodes more effectively exploit complex, multi-view structures compared to pointwise approaches. This provides empirical justification for preferring KNH in high-dimensional, multi-view graph learning contexts [2102.07857].

Source: https://www.emergentmind.com/topics/k-nearest-hyperplanes-knh-model