Beyond Tables: Harnessing Forest Wisdom for Graph-Powered Machine Learning

Author: Denis Avetisyan


A new approach leverages the power of Random Forests to transform tabular data into graph representations, unlocking enhanced performance with Graph Neural Networks.

A novel method constructs a graph representation from tabular data using a random forest, then leverages this graph structure as input to a graph neural network to facilitate prediction-effectively translating relational insights embedded within the data into a form suitable for graph-based learning.
A novel method constructs a graph representation from tabular data using a random forest, then leverages this graph structure as input to a graph neural network to facilitate prediction-effectively translating relational insights embedded within the data into a form suitable for graph-based learning.

This review details RF-GNN, a technique for constructing graph structures from tabular data using Random Forest proximity measures for improved classification performance.

While Graph Neural Networks (GNNs) excel at leveraging relational structure in data, their direct application to tabular datasets-which lack inherent graph representations-remains a challenge. This limitation motivates the work presented in ‘Random-Forest-Induced Graph Neural Networks for Tabular Learning’, which introduces a novel framework, RF-GNN, that constructs instance-level graphs from tabular data using proximity measures derived from random forests. By capturing nonlinear feature interactions, RF-GNN enables the effective use of GNNs for tabular learning, consistently outperforming classical baselines and recent graph construction methods on benchmark datasets. Could this approach unlock new avenues for representation learning and feature engineering in traditionally non-graph-based machine learning tasks?


Beyond Tabular Constraints: Embracing Relational Data Understanding

Historically, machine learning pipelines have demanded substantial effort in the form of manual feature engineering when dealing with tabular datasets. This process involves experts painstakingly identifying and transforming raw data into representations suitable for algorithms, a task prone to human bias and requiring deep domain knowledge. While often yielding improvements, this approach is inherently time-consuming, limiting the speed of iteration and exploration, and frequently fails to capture the most salient information. Furthermore, the resulting features are often brittle, performing poorly on unseen data or when faced with even slight variations in input distribution, thus hindering the development of truly generalizable and robust predictive models.

A significant limitation of conventional machine learning approaches arises from the common practice of converting relational data into a flattened, tabular format. This transformation, while simplifying data handling, invariably discards crucial information about the connections between data points. Consider, for example, a social network or a database of chemical compounds – the relationships defining these structures are essential for understanding their properties and behaviors. When these relationships are lost during flattening, models are forced to learn patterns from incomplete information, resulting in diminished performance and reduced ability to generalize to new, unseen data. Effectively, valuable contextual signals are discarded, hindering the model’s capacity to discern meaningful patterns and potentially leading to inaccurate or suboptimal predictions.

The pursuit of truly robust and generalizable machine learning models necessitates a shift beyond treating data as isolated instances; instead, attention must be given to the inherent relationships within datasets. Models that can effectively extract and leverage these interdependencies demonstrate improved performance, particularly when encountering previously unseen data or variations in input. This ability to generalize stems from a deeper understanding of the underlying data structure, allowing the model to infer patterns and make accurate predictions even when faced with incomplete or noisy information. Ignoring these relationships risks building models that are overly sensitive to specific training examples and fail to capture the broader, more meaningful connections that define the data’s true behavior, ultimately limiting their real-world applicability and predictive power.

Existing techniques for modeling relational dependencies within datasets frequently encounter scalability issues as complexity increases. While methods like graph neural networks and relational databases offer promising avenues, they often demand substantial computational resources – both in terms of processing power and memory – when applied to large-scale, high-dimensional data. The core challenge lies in the combinatorial explosion of possible relationships; exhaustively exploring all interactions becomes quickly intractable. Consequently, current approaches often rely on approximations or simplifications, potentially sacrificing accuracy or overlooking crucial connections. This limitation hinders the development of truly robust and generalizable models capable of fully leveraging the inherent structure within complex relational datasets, creating a need for more efficient algorithms and hardware acceleration.

The proposed RF-GNN method leverages a random forest to extract pairwise proximities from tabular data, converting them into an adjacency matrix for graph neural network processing.
The proposed RF-GNN method leverages a random forest to extract pairwise proximities from tabular data, converting them into an adjacency matrix for graph neural network processing.

RF-GNN: A Synthesis of Random Forests and Graph Neural Networks

RF-GNN constructs graphs by utilizing proximity matrices generated from Random Forest training. These matrices quantify the similarity between data points based on how frequently they co-occur in the trees of the forest. Specifically, the value at position (i,j) in the proximity matrix reflects the proportion of trees in which data points i and j end up in the same terminal node. This approach differs from traditional graph construction methods which often rely on explicit feature engineering or pre-defined distance metrics. By directly leveraging the learned relationships within the Random Forest, RF-GNN creates a data-driven graph structure that captures complex, potentially non-Euclidean relationships present in the data. The resulting graph’s edge weights are directly derived from these proximity values, indicating the strength of the relationship between nodes.

RF-GNN utilizes proximity matrices generated by Random Forests to define graph edge weights, capturing relationships between data points. Standard proximity measures assess overall similarity, while extensions like Out-of-Bag (OOB) Proximity refine this by considering only instances not used in the training of a given tree, reducing bias. RF-GAP (Random Forest Graph Alignment Probability) further enhances accuracy by explicitly modeling the probability of alignment between instances based on the Random Forest’s decision process. These proximity calculations result in weighted edges where higher values indicate stronger relationships and greater confidence in the connection, effectively translating Random Forest’s internal understanding of data relationships into a graph structure suitable for GNN processing.

Utilizing the graph constructed from Random Forest proximity measures as input, RF-GNN integrates the benefits of both Random Forests and Graph Neural Networks. GNNs excel at learning from graph-structured data by propagating information across nodes and edges, but often require a pre-defined graph. RF-GNN bypasses the need for manual graph construction, allowing the GNN to directly operate on a relationship structure derived from the data itself. This combination enables the GNN to leverage the accuracy and similarity information captured by the Random Forest proximities, potentially improving performance on tasks involving relational data. The resulting model benefits from the robustness of Random Forests and the expressive power of Graph Neural Networks.

Traditional Graph Neural Network (GNN) applications often require a pre-existing graph structure to define relationships between data points; however, RF-GNN circumvents this limitation by constructing a graph directly from the data itself. Utilizing proximity matrices generated by Random Forests – which quantify the similarity of data instances based on co-occurrence in tree leaves – RF-GNN establishes connections between nodes without prior knowledge of relationships. This process allows the model to learn directly from raw relational data, effectively transforming tabular or feature-based datasets into graph representations suitable for GNN analysis, and eliminating the need for manual feature engineering or domain expertise to define graph topology.

RF-GNN demonstrates robust performance across five datasets, maintaining stable weighted F1-scores-with some variability in dataset 941-when the proximity threshold α is within the moderate range of <span class="katex-eq" data-katex-display="false"> [0.2, 0.4] </span>.
RF-GNN demonstrates robust performance across five datasets, maintaining stable weighted F1-scores-with some variability in dataset 941-when the proximity threshold α is within the moderate range of [0.2, 0.4] .

Empirical Validation: Superior Node Classification on OpenML-CC18

RF-GNN’s performance was assessed using the OpenML-CC18 benchmark, a collection of 36 diverse graph-structured datasets commonly used for evaluating node classification algorithms. Evaluation utilized a standardized experimental protocol, ensuring fair comparison against existing methods. Performance was measured using the area under the receiver operating characteristic curve (AUC-ROC) as the primary metric, averaged across ten random data splits for each dataset. The benchmark includes graphs varying in size, density, and node features, representing a broad range of real-world applications and providing a comprehensive evaluation of the model’s generalization capability in node classification tasks.

Rigorous evaluation of RF-GNN on the OpenML-CC18 benchmark demonstrated consistent outperformance against established baseline methods. Across 36 distinct datasets within the benchmark, RF-GNN achieved an average rank of 1, indicating it produced the highest-performing results more frequently than any other tested approach. Baselines included traditional machine learning algorithms and standard Graph Neural Network (GNN) architectures, confirming RF-GNN’s effectiveness in node classification tasks within a diverse range of graph-structured data. This ranking metric provides a quantitative assessment of the method’s superiority and robustness.

Evaluation of RF-GNN on the OpenML-CC18 benchmark demonstrates consistent performance gains across a variety of datasets. The method was tested on 36 distinct datasets, representing diverse characteristics in terms of graph structure, node features, and classification tasks. Results indicate RF-GNN achieves state-of-the-art or competitive results on these datasets, suggesting the model’s ability to generalize beyond the specific characteristics of any single dataset. This consistent performance across different data distributions and graph types indicates a high degree of robustness and adaptability, confirming the method is not overly sensitive to variations in input data.

Empirical analysis demonstrated a strong correlation between graph construction methodology and the performance of the RF-GNN model in node classification tasks. Experiments involved varying the proximity metric used to establish node connections during graph construction; results indicated that utilizing Random Forest (RF)-derived proximity consistently yielded superior performance compared to alternative methods such as k-nearest neighbors or Euclidean distance. Specifically, RF-derived proximity effectively captures non-linear relationships and feature interactions within the data, leading to more informative graph structures and improved node classification accuracy across the OpenML-CC18 benchmark. This suggests that the quality of the initial graph representation is a critical factor in the success of the RF-GNN model.

Random Forest proximity consistently yields the highest weighted F1-score across five datasets, demonstrating its superior performance compared to other proximity measures.
Random Forest proximity consistently yields the highest weighted F1-score across five datasets, demonstrating its superior performance compared to other proximity measures.

Expanding the Toolkit: Versatility and Integration of RF-GNN

The Random Feature Graph Neural Network (RF-GNN) distinguishes itself through seamless compatibility with established boosting algorithms, notably XGBoost and LightGBM. This integration isn’t merely additive; it creates a synergistic effect, allowing the RF-GNN to provide rich, graph-based features that these algorithms then leverage for improved predictive accuracy. By combining the strengths of graph representation learning with the efficiency and scalability of gradient boosting, researchers demonstrate substantial performance gains across diverse datasets. This approach overcomes limitations often encountered when applying GNNs to large-scale problems, as the boosting algorithms effectively manage computational complexity while refining the model’s ability to generalize. The resulting hybrid models exhibit both heightened accuracy and improved scalability, positioning RF-GNN as a versatile tool for tackling complex machine learning tasks.

The Random Feature Graph Neural Network (RF-GNN) isn’t intended to replace existing Graph Neural Network (GNN) architectures, but rather to function synergistically with them. Researchers demonstrate that combining RF-GNN with established models like Graph Convolutional Networks (GCN) fosters the creation of hybrid systems capable of outperforming individual architectures. This integration allows for leveraging the distinct strengths of each component – for instance, a GCN’s ability to capture local neighborhood information combined with RF-GNN’s efficient handling of large graphs and feature randomization. By strategically combining these approaches, model designers can address specific data characteristics and optimize performance across a broader range of graph-based machine learning tasks, ultimately building more robust and adaptable predictive systems.

The Random Feature Graph Neural Network (RF-GNN) demonstrates considerable adaptability through its compatibility with data representation techniques such as INCE, or Implicitly Normalized Complementary Encoding. This integration allows the model to move beyond simple feature aggregation and capture more subtle relationships within graph data. INCE works by transforming node features into a higher-dimensional space, emphasizing complementary information and mitigating the impact of noisy or redundant features. By combining RF-GNN’s random feature mapping with INCE’s refined feature space, the resulting model achieves a more nuanced understanding of node characteristics and their connections, ultimately leading to improved performance across diverse graph-based learning tasks. This synergistic effect highlights RF-GNN’s potential as a versatile component within a broader machine learning pipeline.

Investigations into the performance of Random Feature Graph Neural Networks (RF-GNNs) reveal a crucial relationship between graph density and predictive accuracy. Analysis demonstrates that optimal results are achieved when utilizing a proximity threshold between 0.1 and 0.5 during graph construction. This range suggests that moderately dense graph structures – those with a balanced number of connections – are particularly well-suited for the RF-GNN architecture. Too sparse a graph fails to provide sufficient contextual information for effective learning, while overly dense graphs introduce excessive computational cost and potentially obscure meaningful relationships. Consequently, careful calibration of the proximity threshold within this identified range can significantly enhance the model’s ability to generalize and perform effectively across diverse datasets.

The adaptability of RF-GNN positions it as a significant asset within the broader machine learning landscape. Beyond its core functionality, the framework’s capacity to integrate seamlessly with established algorithms – including boosting methods like XGBoost and LightGBM, and complementary graph neural networks such as GCN – unlocks possibilities for customized model development. This interoperability isn’t limited to algorithmic combinations; RF-GNN also supports advanced data representation techniques like INCE, further refining its analytical power. Consequently, researchers and practitioners across diverse fields – from materials science and drug discovery to social network analysis and fraud detection – can leverage RF-GNN to address complex challenges, benefitting from its performance gains and design flexibility while building upon existing machine learning pipelines.

Optimal GNN performance consistently relies on moderate graph density, as evidenced by the concentration of optimal proximity thresholds α between 0.1 and 0.5 across 36 datasets.
Optimal GNN performance consistently relies on moderate graph density, as evidenced by the concentration of optimal proximity thresholds α between 0.1 and 0.5 across 36 datasets.

The presented work on RF-GNN elegantly demonstrates a commitment to structural correctness in machine learning. By transforming tabular data into graph representations via Random Forest proximities, the authors implicitly acknowledge the underlying mathematical relationships within the dataset. This approach mirrors a desire for provable solutions, striving for a representation that isn’t merely effective but logically sound. As Marvin Minsky stated, “Questions are more important than answers.” The research isn’t simply about achieving high classification accuracy; it’s about formulating the right questions regarding data representation and leveraging graph structures to expose inherent relationships, a pursuit of fundamental understanding over superficial results. The method’s reliance on proximity measures, while computationally efficient, ultimately seeks to define a valid and meaningful graph structure – a formalization of data relationships.

Future Directions

The presented work, while demonstrating a pragmatic improvement through the marriage of Random Forests and Graph Neural Networks, merely skirts the fundamental question of representation. Constructing a graph from tabular data via proximity measures-however sophisticated-remains an a posteriori justification. The resulting graph structure is not derived from first principles, but rather imposed upon the data. A truly elegant solution would necessitate a provable mapping from the inherent relationships within the tabular space to a graph structure, guaranteeing a meaningful and information-preserving transformation. The current approach, while empirically successful, lacks such theoretical grounding.

Furthermore, the reliance on Random Forest proximities introduces a dependency on the Random Forest algorithm itself. While the method benefits from the feature importance and interaction capture of Random Forests, it simultaneously becomes tethered to its limitations. Exploring alternative methods for defining edge weights – perhaps leveraging information-theoretic measures or embedding spaces derived from autoencoders – could decouple the graph construction from a specific ensemble method. A formal analysis quantifying the information loss incurred during the tabular-to-graph conversion remains conspicuously absent, and would be a necessary step towards a more rigorous understanding.

Ultimately, the field requires a shift in perspective. The goal should not be simply to adapt Graph Neural Networks to tabular data, but to derive a universal framework for relational learning, where the representation itself-graphical or otherwise-is dictated by the underlying mathematical structure of the data. Intuition and empirical results, while useful, are insufficient. Only a proof of correctness can elevate this line of inquiry from clever engineering to genuine scientific advancement.


Original article: https://arxiv.org/pdf/2602.24224.pdf

Contact the author: https://www.linkedin.com/in/avetisyan/

See also:

2026-03-02 14:16