net.sf.myra.datamining.model
Class AbstractRuleModel

java.lang.Object
  extended by net.sf.myra.datamining.model.AbstractRuleModel
All Implemented Interfaces:
java.io.Serializable, Model
Direct Known Subclasses:
ProbabilisticRuleModel, RuleList, RuleSet

public abstract class AbstractRuleModel
extends java.lang.Object
implements Model, java.io.Serializable

Base class for (flat) rule models.

Version:
$Revision$ $Date:: $
Author:
Fernando Esteban Barril Otero
See Also:
Serialized Form

Nested Class Summary
static class AbstractRuleModel.DefaultGatherer
           
 
Constructor Summary
AbstractRuleModel(java.util.Collection<Rule> rules)
          Default constructor.
 
Method Summary
 void add(Rule rule)
           
 Rule getDefault()
          Returns the default rule.
 Gatherer getGatherer()
          Returns the gatherer instance for this model.
 Label getMajority()
           
 java.util.Collection<Rule> getRules()
           
 boolean hasDefault()
          Checks if the discovered rule set has a default rule (rule with no terms).
 void remove(Rule rule)
           
 void setMajority(Label majority)
           
 int size()
          Returns the number of rules of the model.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.myra.datamining.Model
classify
 

Constructor Detail

AbstractRuleModel

public AbstractRuleModel(java.util.Collection<Rule> rules)
Default constructor.

Parameters:
rules - the collection of discovered rules.
Method Detail

add

public void add(Rule rule)

remove

public void remove(Rule rule)

getRules

public java.util.Collection<Rule> getRules()

getMajority

public Label getMajority()
Returns:
the majority

setMajority

public void setMajority(Label majority)
Parameters:
majority - the majority to set

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hasDefault

public boolean hasDefault()
Checks if the discovered rule set has a default rule (rule with no terms).

Returns:
true if the discovered rule set contains a default rule; false otherwise.

getDefault

public Rule getDefault()
Returns the default rule.

Returns:
the default rule.

size

public int size()
Returns the number of rules of the model.

Returns:
the number of rules of the model.

getGatherer

public Gatherer getGatherer()
Description copied from interface: Model
Returns the gatherer instance for this model.

Specified by:
getGatherer in interface Model
Returns:
the gatherer instance for this model.


Copyright © 2013. All Rights Reserved.