weka.classifiers.rules.part
Class MakeDecList

java.lang.Object
  extended byweka.classifiers.rules.part.MakeDecList
All Implemented Interfaces:
java.io.Serializable

public class MakeDecList
extends java.lang.Object
implements java.io.Serializable

Class for handling a decision list.

Version:
$Revision: 1.12 $
Author:
Eibe Frank (eibe@cs.waikato.ac.nz)
See Also:
Serialized Form

Field Summary
private  double CF
          The confidence for C45-type pruning.
private  int m_seed
          The seed for random number generation.
private  int minNumObj
          Minimum number of objects
private  int numSetS
          How many subsets of equal size?
private  boolean reducedErrorPruning
          Use reduced error pruning?
private  java.util.Vector theRules
          Vector storing the rules.
private  ModelSelection toSelectModeL
          The model selection method.
private  boolean unpruned
          Generated unpruned list?
 
Constructor Summary
MakeDecList(ModelSelection toSelectLocModel, double cf, int minNum)
          Constructor for dec list pruned using C4.5 pruning.
MakeDecList(ModelSelection toSelectLocModel, int minNum)
          Constructor for unpruned dec list.
MakeDecList(ModelSelection toSelectLocModel, int num, int minNum, int seed)
          Constructor for dec list pruned using hold-out pruning.
 
Method Summary
 void buildClassifier(Instances data)
          Builds dec list.
 double classifyInstance(Instance instance)
          Classifies an instance.
 double[] distributionForInstance(Instance instance)
          Returns the class distribution for an instance.
 int numRules()
          Outputs the number of rules in the classifier.
 java.lang.String toString()
          Outputs the classifier into a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

theRules

private java.util.Vector theRules
Vector storing the rules.


CF

private double CF
The confidence for C45-type pruning.


minNumObj

private int minNumObj
Minimum number of objects


toSelectModeL

private ModelSelection toSelectModeL
The model selection method.


numSetS

private int numSetS
How many subsets of equal size? One used for pruning, the rest for training.


reducedErrorPruning

private boolean reducedErrorPruning
Use reduced error pruning?


unpruned

private boolean unpruned
Generated unpruned list?


m_seed

private int m_seed
The seed for random number generation.

Constructor Detail

MakeDecList

public MakeDecList(ModelSelection toSelectLocModel,
                   int minNum)
Constructor for unpruned dec list.


MakeDecList

public MakeDecList(ModelSelection toSelectLocModel,
                   double cf,
                   int minNum)
Constructor for dec list pruned using C4.5 pruning.


MakeDecList

public MakeDecList(ModelSelection toSelectLocModel,
                   int num,
                   int minNum,
                   int seed)
Constructor for dec list pruned using hold-out pruning.

Method Detail

buildClassifier

public void buildClassifier(Instances data)
                     throws java.lang.Exception
Builds dec list.

Throws:
java.lang.Exception - if dec list can't be built successfully

toString

public java.lang.String toString()
Outputs the classifier into a string.


classifyInstance

public double classifyInstance(Instance instance)
                        throws java.lang.Exception
Classifies an instance.

Throws:
java.lang.Exception - if instance can't be classified

distributionForInstance

public double[] distributionForInstance(Instance instance)
                                 throws java.lang.Exception
Returns the class distribution for an instance.

Throws:
java.lang.Exception - if distribution can't be computed

numRules

public int numRules()
Outputs the number of rules in the classifier.