net.sf.jdmf.algorithms.classification
Class OneRuleAlgorithm
java.lang.Object
net.sf.jdmf.algorithms.AbstractDataMiningAlgorithm
net.sf.jdmf.algorithms.classification.OneRuleAlgorithm
- All Implemented Interfaces:
- DataMiningAlgorithm
public class OneRuleAlgorithm
- extends AbstractDataMiningAlgorithm
Implements the 1R classification algorithm as described in Data Mining:
Practical Machine Learning Tools and Techniques (Second Edition)
by Ian H. Witten and Eibe Frank (Morgan Kaufmann, 2005).
The idea is simple:
1. Take an attribute.
2. Select a value of this attribute.
3. Select a value of the decision attribute.
4. Calculate the coverage of an instance containing both attribute values.
5. Repeat 3-4 for all decision values.
6. Choose the instance with the highest coverage (randomly, if there are
more winners) and convert it to a rule.
7. Repeat 2-6 for all values of this attribute.
8. Calculate the error sum for all rules based on this attribute. The error
rate for each rule is defined as the number of times the attribute value
occurs minus the coverage of the rule.
9. Repeat 1-8 for all attributes.
10. Choose the attribute with the smallest error sum and output
classification rules based on this attribute.
If the attribute is numeric, the values are partitioned to achieve
a reasonable number of rules (instead of calculating coverage, which would
result in quite a few rules...).
- Author:
- quorthon
- See Also:
AttributeValuePartitioner
Method Summary |
DataMiningModel |
analyze(InputData inputData)
Analyzes input data (attributes and decisions) and produces output data
(rules, decision trees, clusters, ...). |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OneRuleAlgorithm
public OneRuleAlgorithm()
analyze
public DataMiningModel analyze(InputData inputData)
- Description copied from interface:
DataMiningAlgorithm
- Analyzes input data (attributes and decisions) and produces output data
(rules, decision trees, clusters, ...).
- See Also:
DataMiningAlgorithm.analyze(net.sf.jdmf.data.input.InputData)