Package weka.classifiers.rules.part
Class MakeDecList
- java.lang.Object
-
- weka.classifiers.rules.part.MakeDecList
-
- All Implemented Interfaces:
java.io.Serializable,CapabilitiesHandler,RevisionHandler
public class MakeDecList extends java.lang.Object implements java.io.Serializable, CapabilitiesHandler, RevisionHandler
Class for handling a decision list.- Version:
- $Revision: 5529 $
- Author:
- Eibe Frank (eibe@cs.waikato.ac.nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildClassifier(Instances data)Builds dec list.doubleclassifyInstance(Instance instance)Classifies an instance.double[]distributionForInstance(Instance instance)Returns the class distribution for an instance.CapabilitiesgetCapabilities()Returns default capabilities of the classifier.java.lang.StringgetRevision()Returns the revision string.intnumRules()Outputs the number of rules in the classifier.java.lang.StringtoString()Outputs the classifier into a string.
-
-
-
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
-
getCapabilities
public Capabilities getCapabilities()
Returns default capabilities of the classifier.- Specified by:
getCapabilitiesin interfaceCapabilitiesHandler- Returns:
- the capabilities of this classifier
- See Also:
Capabilities
-
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.- Overrides:
toStringin classjava.lang.Object
-
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.
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Returns:
- the revision
-
-