Rule-Based Machine Learning


Rule-Based Machine Learning

Anna
Hey Simon, have you ever heard of rule-based machine learning? It's not as popular as neural networks, but it's really interesting for biomedical data.

Simon
I've heard of decision trees, but rule-based? Isn't that just a bunch of if-then statements? How would that work for modeling?

Anna
Exactly! A rule is basically an IF condition THEN outcome statement. For example, if a genetic feature is 0 and BMI is less than 20, then predict control. But the model is a set of rules, each covering a piece of the problem space.

Simon
So it's like breaking the data into regions? That sounds like a decision tree, but I guess trees are hierarchical. What's special about rule-based methods?

Anna
One key advantage is interpretability. Also, they handle complex interactions and heterogeneous associations well. There's a family called Learning Classifier Systems, or LCS, that uses evolutionary algorithms to discover rules.

Simon
Evolutionary algorithms? Like genetic algorithms? So they evolve rules over time? But what are the downsides?

Anna
Right. Downsides include being less known, fewer software packages, and they can be computationally expensive. Also, there's little theoretical proof they converge, but empirically they work well.

Simon
That makes sense. So how does training an LCS actually work? I imagine it's iterative.

Anna
Yes, it cycles through the data one instance at a time. First, we grab an instance and match it against all rules in the population. Matching checks if the rule's conditions are satisfied by that instance.

Simon
And then we form a match set of rules that match. But what if no rules match? Or if they match but predict wrong?

Anna
We split the match set into correct and incorrect sets based on whether the rule's prediction matches the true class. If the correct set is empty, we activate a covering mechanism that randomly generates a new rule that matches the instance and predicts correctly.

Simon
That sounds like a way to bootstrap the population. Then we update parameters like accuracy and fitness for all matched rules?

Anna
Exactly. Correct rules get a boost, incorrect get penalized. Then there's an explicit generalization step called subsumption where a more general rule can absorb a more specific one if they're equally accurate. That helps prevent overfitting.

Simon
Interesting. And then the genetic algorithm comes in for rule discovery?

Anna
Yes. We select two parent rules from the correct set, usually fitter ones have higher chance. Then we apply crossover and mutation to create offspring rules, which are added to the population. This introduces new variation.

Simon
But the population can't grow indefinitely, right? There must be a deletion mechanism.

Anna
Right. When the population exceeds a maximum size, we delete rules probabilistically, with less fit rules more likely to be removed. The cycle repeats until a stopping criterion, like a maximum number of iterations.

Simon
So after training, we have a population of rules. But do we use all of them for predictions?

Anna
Often we apply rule compaction to prune the set. Then for a new instance, we find the match set and use a prediction array that considers the fitness and numerosity of rules supporting each class. The class with more support wins.

Simon
That's quite a process. But it seems very flexible, especially for biomedical data with complex interactions. Where can I learn more?

Anna
There's a great 12-minute animated video on YouTube, and a textbook by Urbanowicz and Brown. Also, scikit-learn compatible implementations are available on their lab's GitHub.

Ask anything
We've read this whole study set, so questions about it get the best answers.