|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.Classifier
weka.classifiers.DistributionClassifier
weka.classifiers.rules.part.PART
Class for generating a PART decision list. For more information, see
Eibe Frank and Ian H. Witten (1998). Generating Accurate Rule Sets Without Global Optimization. In Shavlik, J., ed., Machine Learning: Proceedings of the Fifteenth International Conference, Morgan Kaufmann Publishers, San Francisco, CA.
Valid options are:
-C confidence
Set confidence threshold for pruning. (Default: 0.25)
-M number
Set minimum number of instances per leaf. (Default: 2)
-R
Use reduced error pruning.
-N number
Set number of folds for reduced error pruning. One fold is
used as the pruning set. (Default: 3)
-B
Use binary splits for nominal attributes.
-U
Generate unpruned decision list.
Constructor Summary | |
PART()
|
Method Summary | |
void |
buildClassifier(Instances instances)
Generates the classifier. |
double |
classifyInstance(Instance instance)
Classifies an instance. |
double[] |
distributionForInstance(Instance instance)
Returns class probabilities for an instance. |
java.util.Enumeration |
enumerateMeasures()
Returns an enumeration of the additional measure names |
boolean |
getBinarySplits()
Get the value of binarySplits. |
float |
getConfidenceFactor()
Get the value of CF. |
double |
getMeasure(java.lang.String additionalMeasureName)
Returns the value of the named measure |
int |
getMinNumObj()
Get the value of minNumObj. |
int |
getNumFolds()
Get the value of numFolds. |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier. |
boolean |
getReducedErrorPruning()
Get the value of reducedErrorPruning. |
boolean |
getUnpruned()
Get the value of unpruned. |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
double |
measureNumRules()
Return the number of rules. |
void |
setBinarySplits(boolean v)
Set the value of binarySplits. |
void |
setConfidenceFactor(float v)
Set the value of CF. |
void |
setMinNumObj(int v)
Set the value of minNumObj. |
void |
setNumFolds(int v)
Set the value of numFolds. |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setReducedErrorPruning(boolean v)
Set the value of reducedErrorPruning. |
void |
setUnpruned(boolean newunpruned)
Set the value of unpruned. |
java.lang.String |
toString()
Returns a description of the classifier |
java.lang.String |
toSummaryString()
Returns a superconcise version of the model |
Methods inherited from class weka.classifiers.DistributionClassifier |
calculateEntropy, calculateLabeledInstanceMargin, calculateMargin |
Methods inherited from class weka.classifiers.Classifier |
forName, makeCopies |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PART()
Method Detail |
public void buildClassifier(Instances instances) throws java.lang.Exception
buildClassifier
in class Classifier
instances
- set of instances serving as training data
java.lang.Exception
- if classifier can't be built successfullypublic double classifyInstance(Instance instance) throws java.lang.Exception
classifyInstance
in class DistributionClassifier
instance
- the instance to be classified
java.lang.Exception
- if instance can't be classified successfullypublic final double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in class DistributionClassifier
instance
- the instance to be classified
java.lang.Exception
- if the distribution can't be computed successfullypublic java.util.Enumeration listOptions()
-C confidence
Set confidence threshold for pruning. (Default: 0.25)
-M number
Set minimum number of instances per leaf. (Default: 2)
-R
Use reduced error pruning.
-N number
Set number of folds for reduced error pruning. One fold is
used as the pruning set. (Default: 3)
-B
Use binary splits for nominal attributes.
-U
Generate unpruned decision list.
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
setOptions
in interface OptionHandler
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public java.lang.String toString()
public java.lang.String toSummaryString()
toSummaryString
in interface Summarizable
public double measureNumRules()
public java.util.Enumeration enumerateMeasures()
enumerateMeasures
in interface AdditionalMeasureProducer
public double getMeasure(java.lang.String additionalMeasureName)
getMeasure
in interface AdditionalMeasureProducer
additionalMeasureName
- the name of the measure to query for its value
java.lang.IllegalArgumentException
- if the named measure is not supportedpublic float getConfidenceFactor()
public void setConfidenceFactor(float v)
v
- Value to assign to CF.public int getMinNumObj()
public void setMinNumObj(int v)
v
- Value to assign to minNumObj.public boolean getReducedErrorPruning()
public void setReducedErrorPruning(boolean v)
v
- Value to assign to reducedErrorPruning.public boolean getUnpruned()
public void setUnpruned(boolean newunpruned)
newunpruned
- Value to assign to unpruned.public int getNumFolds()
public void setNumFolds(int v)
v
- Value to assign to numFolds.public boolean getBinarySplits()
public void setBinarySplits(boolean v)
v
- Value to assign to binarySplits.public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |