Relational Random Forests Based on Random Relational Rules

Grant Anderson, Bernhard Pfahringer

Introduction

Standard Random Forests are designed for "propositional" data—flat spreadsheets where each row is an independent instance. However, real-world data is often relational, such as molecules composed of atoms and bonds or financial transactions linked to accounts. Existing approaches to relational learning, such as First-Order Random Forests (FORF), struggle with computational complexity and variable scoping issues. Searching for the optimal logical predicate at every node is slow, and variables introduced in one node are often only valid in specific branches, making trees difficult to interpret and build efficiently.

This paper introduces $R^4F$ (Relational Random Forests based on Random Relational Rules), an algorithm that brings the power of Random Forests to complex relational data. By using randomly generated logical rules as self-contained tests within tree nodes, $R^4F$ achieves significant speedups and better parallelization than previous relational ensemble methods.

The $R^4F$ Methodology

The core innovation of $R^4F$ is the use of dynamic propositionalization through Random Relational Rules.

  • Self-Contained Tests: Instead of a single predicate, each node in an $R^4F$ tree uses a full, self-contained logical rule (a definite clause) as a Boolean test. For example: "Does this molecule have an atom with charge > 0.078 AND two bonds of different types?"
  • Staggered Parallel Growth: Unlike standard forests that grow one tree at a time, $R^4F$ grows all trees simultaneously. It generates a random rule, calculates its "coverage" (which examples it satisfies) across the entire dataset once, and then offers that rule to every "open" leaf in every tree in the forest.
  • Maximum Rule Count (MRC): Each node "listens" to a stream of random rules. After a user-defined number of rules (the MRC), the node picks the one that provided the best information gain and splits, or becomes a leaf if no good split was found.
Staggered parallel growth of trees A, B, C, and D using shared random rules R1, R2, and R3.

Key Insights

  • Efficiency through Sharing: The most expensive part of relational learning is "coverage computation." $R^4F$ performs this once per rule for the whole dataset and shares the result across all trees, drastically reducing redundant work.
  • Simplicity of Interpretation: Because each node uses a self-contained rule, the path from root to leaf is much easier to interpret than traditional relational trees where variables are "chained" across levels.
  • Dynamic vs. Static: Generating rules "on-the-fly" as the tree grows is more efficient than "static propositionalization" (generating thousands of rules upfront), as the tree only uses the rules it actually needs to reach a stopping condition.

Experimental Results

The algorithm was evaluated on several classic Inductive Logic Programming (ILP) benchmarks, including Mutagenesis, Carcinogenesis, and Diterpenes.

  • Speed: $R^4F$ is significantly faster than FORF because it avoids the exhaustive search for predicates at every node.
  • Accuracy: $R^4F$ achieved comparable or superior accuracy to FORF on the Mutagenesis (79.1% vs 74.7%) and Financial (87.8% vs 85.7%) datasets.
  • Significance: On the Diterpenes datasets, $R^4F$ significantly outperformed static propositionalization, proving that the "dynamic" approach captures relational patterns more effectively.
Accuracy comparison between R4F and static propositionalization across standard ILP benchmarks.

Limitations and Future Work

While $R^4F$ shows great promise, it currently lacks support for "aggregates" (e.g., "count the number of atoms"). This was evident in the Financial dataset results, where FORF variants that included aggregates achieved near 99% accuracy, while $R^4F$ stayed at 87.8%. Additionally, the current implementation is limited to binary classification. Future work aims to integrate aggregate functions into the random rule generation process to handle more complex numerical relational data.

Summary updated

BibTeX
@inproceedings{anderson2009relational,
  author = {Grant Anderson and Bernhard Pfahringer},
  title = {{Relational Random Forests Based on Random Relational Rules}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2009},
}
Figure