public class JRip extends AbstractClassifier implements AdditionalMeasureProducer, WeightedInstancesHandler, TechnicalInformationHandler
@inproceedings{Cohen1995, author = {William W. Cohen}, booktitle = {Twelfth International Conference on Machine Learning}, pages = {115-123}, publisher = {Morgan Kaufmann}, title = {Fast Effective Rule Induction}, year = {1995} }Valid options are:
-F <number of folds> Set number of folds for REP One fold is used as pruning set. (default 3)
-N <min. weights> Set the minimal weights of instances within a split. (default 2.0)
-O <number of runs> Set the number of runs of optimizations. (Default: 2)
-D Set whether turn on the debug mode (Default: false)
-S <seed> The seed of randomization (Default: 1)
-E Whether NOT check the error rate>=0.5 in stopping criteria (default: check)
-P Whether NOT use pruning (default: use pruning)
Modifier and Type | Class and Description |
---|---|
class |
JRip.Antd
The single antecedent in the rule, which is composed of an attribute and
the corresponding value.
|
class |
JRip.NominalAntd
The antecedent with nominal attribute
|
class |
JRip.NumericAntd
The antecedent with numeric attribute
|
class |
JRip.RipperRule
This class implements a single rule that predicts specified class.
|
Constructor and Description |
---|
JRip() |
Modifier and Type | Method and Description |
---|---|
void |
buildClassifier(Instances instances)
Builds Ripper in the order of class frequencies.
|
String |
checkErrorRateTipText()
Returns the tip text for this property
|
String |
debugTipText()
Returns the tip text for this property
|
double[] |
distributionForInstance(Instance datum)
Classify the test instance with the rule learner and provide
the class distributions
|
Enumeration |
enumerateMeasures()
Returns an enumeration of the additional measure names
|
String |
foldsTipText()
Returns the tip text for this property
|
Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
boolean |
getCheckErrorRate()
Gets whether to check for error rate is in stopping criterion
|
boolean |
getDebug()
Gets whether debug information is output to the console
|
int |
getFolds()
Gets the number of folds
|
double |
getMeasure(String additionalMeasureName)
Returns the value of the named measure
|
double |
getMinNo()
Gets the minimum total weight of the instances in a rule
|
int |
getOptimizations()
Gets the the number of optimization runs
|
String[] |
getOptions()
Gets the current settings of the Classifier.
|
String |
getRevision()
Returns the revision string.
|
FastVector |
getRuleset()
Get the ruleset generated by Ripper
|
RuleStats |
getRuleStats(int pos)
Get the statistics of the ruleset in the given position
|
long |
getSeed()
Gets the current seed value to use in randomizing the data
|
TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing
detailed information about the technical background of this class,
e.g., paper reference or book this class is based on.
|
boolean |
getUsePruning()
Gets whether pruning is performed
|
String |
globalInfo()
Returns a string describing classifier
|
Enumeration |
listOptions()
Returns an enumeration describing the available options
Valid options are:
|
static void |
main(String[] args)
Main method.
|
String |
minNoTipText()
Returns the tip text for this property
|
String |
optimizationsTipText()
Returns the tip text for this property
|
String |
seedTipText()
Returns the tip text for this property
|
void |
setCheckErrorRate(boolean d)
Sets whether to check for error rate is in stopping criterion
|
void |
setDebug(boolean d)
Sets whether debug information is output to the console
|
void |
setFolds(int fold)
Sets the number of folds to use
|
void |
setMinNo(double m)
Sets the minimum total weight of the instances in a rule
|
void |
setOptimizations(int run)
Sets the number of optimization runs
|
void |
setOptions(String[] options)
Parses a given list of options.
|
void |
setSeed(long s)
Sets the seed value to use in randomizing the data
|
void |
setUsePruning(boolean d)
Sets whether pruning is performed
|
String |
toString()
Prints the all the rules of the rule learner.
|
String |
usePruningTipText()
Returns the tip text for this property
|
classifyInstance, forName, makeCopies, makeCopy, runClassifier
public String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public Enumeration listOptions()
-F number
The number of folds for reduced error pruning. One fold is
used as the pruning set. (Default: 3)
-N number
The minimal weights of instances within a split.
(Default: 2)
-O number
Set the number of runs of optimizations. (Default: 2)
-D
Whether turn on the debug mode
-S number
The seed of randomization used in Ripper.(Default: 1)
-E
Whether NOT check the error rate >= 0.5 in stopping criteria.
(default: check)
-P
Whether NOT use pruning. (default: use pruning)
listOptions
in interface OptionHandler
listOptions
in class AbstractClassifier
public void setOptions(String[] options) throws Exception
-F <number of folds> Set number of folds for REP One fold is used as pruning set. (default 3)
-N <min. weights> Set the minimal weights of instances within a split. (default 2.0)
-O <number of runs> Set the number of runs of optimizations. (Default: 2)
-D Set whether turn on the debug mode (Default: false)
-S <seed> The seed of randomization (Default: 1)
-E Whether NOT check the error rate>=0.5 in stopping criteria (default: check)
-P Whether NOT use pruning (default: use pruning)
setOptions
in interface OptionHandler
setOptions
in class AbstractClassifier
options
- the list of options as an array of stringsException
- if an option is not supportedpublic String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class AbstractClassifier
public Enumeration enumerateMeasures()
enumerateMeasures
in interface AdditionalMeasureProducer
public double getMeasure(String additionalMeasureName)
getMeasure
in interface AdditionalMeasureProducer
additionalMeasureName
- the name of the measure to query for its valueIllegalArgumentException
- if the named measure is not supportedpublic String foldsTipText()
public void setFolds(int fold)
fold
- the number of foldspublic int getFolds()
public String minNoTipText()
public void setMinNo(double m)
m
- the minimum total weight of the instances in a rulepublic double getMinNo()
public String seedTipText()
public void setSeed(long s)
s
- the new seed valuepublic long getSeed()
public String optimizationsTipText()
public void setOptimizations(int run)
run
- the number of optimization runspublic int getOptimizations()
public String debugTipText()
debugTipText
in class AbstractClassifier
public void setDebug(boolean d)
setDebug
in class AbstractClassifier
d
- whether debug information is output to the consolepublic boolean getDebug()
getDebug
in class AbstractClassifier
public String checkErrorRateTipText()
public void setCheckErrorRate(boolean d)
d
- whether to check for error rate is in stopping criterionpublic boolean getCheckErrorRate()
public String usePruningTipText()
public void setUsePruning(boolean d)
d
- Whether pruning is performedpublic boolean getUsePruning()
public FastVector getRuleset()
public RuleStats getRuleStats(int pos)
pos
- the position of the stats, assuming correctpublic Capabilities getCapabilities()
getCapabilities
in interface Classifier
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class AbstractClassifier
Capabilities
public void buildClassifier(Instances instances) throws Exception
buildClassifier
in interface Classifier
instances
- the training dataException
- if classifier can't be built successfullypublic double[] distributionForInstance(Instance datum)
distributionForInstance
in interface Classifier
distributionForInstance
in class AbstractClassifier
datum
- the instance to be classifiedpublic String toString()
public String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClassifier
public static void main(String[] args)
args
- the options for the classifierCopyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.