|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.Classifier
weka.classifiers.SingleClassifierEnhancer
weka.classifiers.RandomizableSingleClassifierEnhancer
weka.classifiers.rules.FR3
public class FR3
FR3 - Fuzzy Round Robin Ripper
The FR3 algorithm is a pairwise classification algorithm which uses a modified version of the Ripper algorithm in combination with fuzzification techniques. The classification itself is achieved via pairwise preferences instead of voting.
@article{huehn2008, author = {Jens Christian Hühn and Eyke Hüllermeier}, journal = {}, title = {FR3: A Fuzzy Rule Learner for Inducing Reliable Classifiers}, year = {2008} }Valid options are:
-d If set, the classifier will safe the binary models to the specified path after learning. When the first classification is done, the models will be retrieved.
-P <str> The path to which the models are saved. (default "./")
-B If set, the classifier learns all n(n-1) models, otherwise it learns only one class per pair and thus n(n-1)/2 models
-S <num> Random number seed. (default 1)
-D If set, classifier is run in debug mode and may output additional info to the console
-W Full name of base classifier. (default: weka.classifiers.rules.FRip)
Options specific to classifier weka.classifiers.rules.FRip:
-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)Date created: 08/07/2008
Field Summary | |
---|---|
private double[] |
aprioriClassDistribution
An array which stores the class distribution of the training data |
protected weka.core.Attribute |
m_ClassAttribute
Internal copy of the class attribute for output purposes |
protected weka.filters.Filter[] |
m_ClassFilters
The filters used to transform the class. |
weka.classifiers.Classifier[] |
m_Classifiers
The classifiers. |
private java.lang.String |
m_filenamePattern
The filename which is used for pairwise models which are written to disk. |
private boolean |
m_filesWereLoaded
A flag which shows that the saved models may have already been loaded to the RAM |
protected boolean |
m_learnBothModelsForEachPairOfClasses
Switch which determines whether all n(n-1) models are learned or only n(n-1)/2 models. |
private java.lang.String |
m_modelSafePath
The path to which the binary models are written |
private java.util.Random |
m_Random
The random variable generator |
private boolean |
m_safeModelToDiskAfterLearning
A switch which determines whether the binary models should be cached to the harddrive (to free RAM for other classifiers temporarily) |
protected weka.core.Instances |
m_TwoClassDataset
A transformed dataset header used by the 1-against-1 method |
private static long |
serialVersionUID
for serialization |
Fields inherited from class weka.classifiers.RandomizableSingleClassifierEnhancer |
---|
m_Seed |
Fields inherited from class weka.classifiers.SingleClassifierEnhancer |
---|
m_Classifier |
Fields inherited from class weka.classifiers.Classifier |
---|
m_Debug |
Constructor Summary | |
---|---|
FR3()
Constructor. |
Method Summary | |
---|---|
void |
buildClassifier(weka.core.Instances instances)
Builds the classifiers. |
double |
classifyInstance(weka.core.Instance inst)
Classifies an instance. |
protected java.lang.String |
defaultClassifierString()
String describing default classifier. |
double[] |
distributionForInstance(weka.core.Instance inst)
Predicts the class memberships for a given instance. |
weka.core.Capabilities |
getCapabilities()
Returns default capabilities of the classifier. |
boolean |
getLearnBothModelsForEachPairOfClasses()
Gets whether all n(n-1) models (true) or only the n(n-1)/2 models, which is one model per pair. |
java.lang.String |
getModelSafePath()
Get the path to which the models are stored between learning and classification |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier. |
java.lang.String |
getRevision()
Returns the revision string. |
boolean |
getSafeModelToDiskAfterLearning()
Gets whether the pairwise models should be safed to the harddrive after learning and be loaded upon classification |
weka.core.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. |
java.lang.String |
globalInfo()
Returns a string describing classifier |
java.lang.String |
learnBothModelsForEachPairOfClassesTipText()
|
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options |
private weka.classifiers.Classifier |
loadModel(java.lang.String fileName)
A function which loads a saved model from disk to memory. |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
java.lang.String |
modelSafePathTipText()
|
double[][][] |
relationsForInstance(weka.core.Instance inst)
Retrieves the preference, conflict and ignorance matrices for a single instance |
java.lang.String |
safeModelToDiskAfterLearningTipText()
|
void |
saveModel(weka.classifiers.Classifier c,
java.lang.String fileName)
A function which saves a given model to disk |
void |
setLearnBothModelsForEachPairOfClasses(boolean b)
Sets whether all n(n-1) models (true) or only the n(n-1)/2 models, which is one model per pair. |
void |
setModelSafePath(java.lang.String p)
Set the path to which the models are stored between learning and classification |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setSafeModelToDiskAfterLearning(boolean b)
Sets whether the pairwise models should be safed to the harddrive after learning and be loaded upon classification |
java.lang.String |
toString()
Prints the classifiers. |
Methods inherited from class weka.classifiers.RandomizableSingleClassifierEnhancer |
---|
getSeed, seedTipText, setSeed |
Methods inherited from class weka.classifiers.SingleClassifierEnhancer |
---|
classifierTipText, getClassifier, getClassifierSpec, setClassifier |
Methods inherited from class weka.classifiers.Classifier |
---|
debugTipText, forName, getDebug, makeCopies, makeCopy, runClassifier, setDebug |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
public weka.classifiers.Classifier[] m_Classifiers
protected weka.filters.Filter[] m_ClassFilters
protected weka.core.Attribute m_ClassAttribute
protected weka.core.Instances m_TwoClassDataset
protected boolean m_learnBothModelsForEachPairOfClasses
private double[] aprioriClassDistribution
private boolean m_safeModelToDiskAfterLearning
private java.lang.String m_modelSafePath
private boolean m_filesWereLoaded
private java.lang.String m_filenamePattern
private java.util.Random m_Random
Constructor Detail |
---|
public FR3()
Method Detail |
---|
protected java.lang.String defaultClassifierString()
defaultClassifierString
in class weka.classifiers.SingleClassifierEnhancer
public weka.core.Capabilities getCapabilities()
getCapabilities
in interface weka.core.CapabilitiesHandler
getCapabilities
in class weka.classifiers.SingleClassifierEnhancer
Capabilities
public weka.core.TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface weka.core.TechnicalInformationHandler
public void buildClassifier(weka.core.Instances instances) throws java.lang.Exception
buildClassifier
in class weka.classifiers.Classifier
instances
- the training data.
java.lang.Exception
- if a classifier can't be builtpublic double[] distributionForInstance(weka.core.Instance inst) throws java.lang.Exception
weka.classifiers.Classifier
distributionForInstance
in class weka.classifiers.Classifier
inst
- the instance to be classified
java.lang.Exception
- if distribution could not be
computed successfullypublic double classifyInstance(weka.core.Instance inst) throws java.lang.Exception
classifyInstance
in class weka.classifiers.Classifier
inst
- the instance to classify
java.lang.Exception
- if instance can't be classified successfullypublic double[][][] relationsForInstance(weka.core.Instance inst) throws java.lang.Exception
relationsForInstance
in interface PreferenceStructureHandler
inst
- The instance for which the PCI-matrices shall be created
java.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Enumeration listOptions()
listOptions
in interface weka.core.OptionHandler
listOptions
in class weka.classifiers.RandomizableSingleClassifierEnhancer
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-d If set, the classifier will safe the binary models to the specified path after learning. When the first classification is done, the models will be retrieved.
-P <str> The path to which the models are saved. (default "./")
-B If set, the classifier learns all n(n-1) models, otherwise it learns only one class per pair and thus n(n-1)/2 models
-S <num> Random number seed. (default 1)
-D If set, classifier is run in debug mode and may output additional info to the console
-W Full name of base classifier. (default: weka.classifiers.rules.FRip)
Options specific to classifier weka.classifiers.rules.FRip:
-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)
setOptions
in interface weka.core.OptionHandler
setOptions
in class weka.classifiers.RandomizableSingleClassifierEnhancer
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 weka.core.OptionHandler
getOptions
in class weka.classifiers.RandomizableSingleClassifierEnhancer
public java.lang.String safeModelToDiskAfterLearningTipText()
public void setSafeModelToDiskAfterLearning(boolean b)
b
- true if the models shall be saved to diskpublic boolean getSafeModelToDiskAfterLearning()
public java.lang.String learnBothModelsForEachPairOfClassesTipText()
public boolean getLearnBothModelsForEachPairOfClasses()
public void setLearnBothModelsForEachPairOfClasses(boolean b)
b
- true for two models per pair, false for only one model for each pairpublic java.lang.String modelSafePathTipText()
public void setModelSafePath(java.lang.String p)
p
- the path to which the models are stroredpublic java.lang.String getModelSafePath()
public java.lang.String globalInfo()
private weka.classifiers.Classifier loadModel(java.lang.String fileName) throws java.io.FileNotFoundException, java.io.IOException, java.lang.ClassNotFoundException
fileName
- The filename for the file in which the classifier is stored
java.io.FileNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void saveModel(weka.classifiers.Classifier c, java.lang.String fileName) throws java.io.FileNotFoundException, java.io.IOException
c
- The classifier which shall be savedfileName
- The filename which describes the file in which the classifier is saved
java.io.FileNotFoundException
java.io.IOException
public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- the options
java.lang.Exception
public java.lang.String getRevision()
weka.core.RevisionHandler
getRevision
in interface weka.core.RevisionHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |