All Packages Class Hierarchy This Package Previous Next Index WEKA's home
Class weka.classifiers.j48.PART
java.lang.Object
|
+----weka.classifiers.Classifier
|
+----weka.classifiers.DistributionClassifier
|
+----weka.classifiers.j48.PART
- public class PART
- extends DistributionClassifier
- implements OptionHandler, WeightedInstancesHandler, Summarizable
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.
- Version:
- $Revision: 1.9 $
- Author:
- Eibe Frank (eibe@cs.waikato.ac.nz)
-
PART()
-
-
buildClassifier(Instances)
- Generates the classifier.
-
classifyInstance(Instance)
- Classifies an instance.
-
distributionForInstance(Instance)
-
Returns class probabilities for an instance.
-
getBinarySplits()
- Get the value of binarySplits.
-
getConfidenceFactor()
- Get the value of CF.
-
getMinNumObj()
- Get the value of minNumObj.
-
getNumFolds()
- Get the value of numFolds.
-
getOptions()
- Gets the current settings of the Classifier.
-
getReducedErrorPruning()
- Get the value of reducedErrorPruning.
-
listOptions()
- Returns an enumeration describing the available options
Valid options are:
-C confidence
Set confidence threshold for pruning.
-
main(String[])
- Main method for testing this class.
-
setBinarySplits(boolean)
- Set the value of binarySplits.
-
setConfidenceFactor(float)
- Set the value of CF.
-
setMinNumObj(int)
- Set the value of minNumObj.
-
setNumFolds(int)
- Set the value of numFolds.
-
setOptions(String[])
- Parses a given list of options.
-
setReducedErrorPruning(boolean)
- Set the value of reducedErrorPruning.
-
toString()
- Returns a description of the classifier
-
toSummaryString()
- Returns a superconcise version of the model
PART
public PART()
buildClassifier
public void buildClassifier(Instances instances) throws Exception
- Generates the classifier.
- Throws: Exception
- if classifier can't be built successfully
- Overrides:
- buildClassifier in class Classifier
classifyInstance
public double classifyInstance(Instance instance) throws Exception
- Classifies an instance.
- Throws: Exception
- if instance can't be classified successfully
- Overrides:
- classifyInstance in class DistributionClassifier
distributionForInstance
public final double[] distributionForInstance(Instance instance) throws Exception
- Returns class probabilities for an instance.
- Throws: Exception
- if the distribution can't be computed successfully
- Overrides:
- distributionForInstance in class DistributionClassifier
listOptions
public Enumeration listOptions()
- Returns an enumeration describing the available options
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.
- Returns:
- an enumeration of all the available options
setOptions
public void setOptions(String options[]) throws Exception
- Parses a given list of options.
- Parameters:
- options - the list of options as an array of strings
- Throws: Exception
- if an option is not supported
getOptions
public String[] getOptions()
- Gets the current settings of the Classifier.
- Returns:
- an array of strings suitable for passing to setOptions
toString
public String toString()
- Returns a description of the classifier
- Overrides:
- toString in class Object
toSummaryString
public String toSummaryString()
- Returns a superconcise version of the model
getConfidenceFactor
public float getConfidenceFactor()
- Get the value of CF.
- Returns:
- Value of CF.
setConfidenceFactor
public void setConfidenceFactor(float v)
- Set the value of CF.
- Parameters:
- v - Value to assign to CF.
getMinNumObj
public int getMinNumObj()
- Get the value of minNumObj.
- Returns:
- Value of minNumObj.
setMinNumObj
public void setMinNumObj(int v)
- Set the value of minNumObj.
- Parameters:
- v - Value to assign to minNumObj.
getReducedErrorPruning
public boolean getReducedErrorPruning()
- Get the value of reducedErrorPruning.
- Returns:
- Value of reducedErrorPruning.
setReducedErrorPruning
public void setReducedErrorPruning(boolean v)
- Set the value of reducedErrorPruning.
- Parameters:
- v - Value to assign to reducedErrorPruning.
getNumFolds
public int getNumFolds()
- Get the value of numFolds.
- Returns:
- Value of numFolds.
setNumFolds
public void setNumFolds(int v)
- Set the value of numFolds.
- Parameters:
- v - Value to assign to numFolds.
getBinarySplits
public boolean getBinarySplits()
- Get the value of binarySplits.
- Returns:
- Value of binarySplits.
setBinarySplits
public void setBinarySplits(boolean v)
- Set the value of binarySplits.
- Parameters:
- v - Value to assign to binarySplits.
main
public static void main(String argv[])
- Main method for testing this class.
- Parameters:
- String - options
All Packages Class Hierarchy This Package Previous Next Index WEKA's home