AI4R implements the ID3 algorithm (Quinlan) as one of its automatic classifiers. Given a set of preclassified examples, it builds a top-down induction of decision tree, biased by the information gain and entropy measure.
The good thing about this automatic learning method is that humans learns as well. Unlike other AI techniques like neural networks, classifiers can generate ruby code with if / else sentences. You can use this to evaluate parameters on realtime, copy paste them in a code, or just read them to learn about your problem domain.
Let's suppose that you are writting an application that must identify people as relevant marketing targets or not. The only information that you have is a collection of examples, provided by a marketing survey:
You can create an ID3 Decision tree to do the dirty job for you:
The Decision tree will automatically create the "rules" to parse new data, and identify new posible marketing targets:
In real life you will use many more data training examples, with more attributes. Consider moving your data to an external CSV (comma separate values) file.
The ID3 class provides a method to evaluate new data.
But instead of going through the tree every time, you can take advantage of the fact that the method "to_s" generates proper ruby code!
Wikipedia article on Decision trees Wikipedia article on ID3 Algorithm