Master rule learning for relational data. Learn first-order logic, variables and predicates, the FOIL algorithm, and applications to social networks and recommendation systems.
Propositional rules can only handle attribute-value data (tabular format). They cannot express relationships between entities, such as "user X follows user Y" or "product A is similar to product B". First-order rules extend rule learning to relational data by introducing variables and predicates.
Variables (typically uppercase letters like ) represent entities or objects in the domain. They can be instantiated to specific values.
Example:
In social network: and represent users., is one instantiation.
Predicates are relations or properties that can be true or false for given entities. They take variables or constants as arguments.
Examples:
First-order rules use variables and predicates to express relationships:
This rule states: "If X follows Y AND X and Y have similar interests, then recommend Y to X."
FOIL (First-Order Inductive Learner) extends sequential covering to first-order rules. It uses the same divide-and-conquer framework but generates candidate literals from predicates instead of attribute-value pairs.
FOIL follows sequential covering:
For each predicate in the background knowledge, FOIL generates candidate literals:
Types of Candidates:
F-GAIN is the first-order extension of information gain. It measures the improvement in rule quality when adding a candidate literal to the current rule.
Where:
Interpretation:
F-GAIN measures the reduction in entropy (uncertainty) weighted by the number of positive examples covered. Higher F-GAIN means the literal significantly improves rule quality by increasing accuracy while maintaining or increasing positive coverage.
Apply FOIL to learn recommendation rules for a social network. Predict when to recommend user Y to user X based on their relationships and attributes.
| User X | User Y | Follows | Similar Interests | Same City | Recommend |
|---|---|---|---|---|---|
| Alice | Bob | Yes | Yes | Yes | Yes |
| Alice | Charlie | No | Yes | No | Yes |
| Bob | Alice | Yes | Yes | Yes | Yes |
| Bob | David | No | No | Yes | No |
| Charlie | Alice | Yes | Yes | No | Yes |
Goal: Learn rule predicting when to recommend user Y to user X based on relationships.
Covers all 5 examples (3 positive, 2 negative). Accuracy: 60%.
Candidate literals: ,,
F-GAIN for : 0.42 (highest)
Covers 3 examples (3 positive, 0 negative). Accuracy: 100%.
Perfect accuracy (100%) covering all positive examples. Rule states: "If X follows Y, then recommend Y to X."