|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.Classifier
weka.classifiers.RandomizableClassifier
weka.classifiers.misc.OLM
public class OLM
This class is an implementation of the Ordinal Learning Method
Further information regarding the algorithm and variants can be found in:
Arie Ben-David (1992). Automatic Generation of Symbolic Multiattribute Ordinal Knowledge-Based DSSs: methodology and Applications. Decision Sciences. 23:1357-1372.
Lievens, Stijn (2003-2004). Studie en implementatie van instantie-gebaseerde algoritmen voor gesuperviseerd rangschikken..
@article{Ben-David1992, author = {Arie Ben-David}, journal = {Decision Sciences}, pages = {1357-1372}, title = {Automatic Generation of Symbolic Multiattribute Ordinal Knowledge-Based DSSs: methodology and Applications}, volume = {23}, year = {1992} } @mastersthesis{Lievens2003-2004, author = {Lievens, Stijn}, school = {Ghent University}, title = {Studie en implementatie van instantie-gebaseerde algoritmen voor gesuperviseerd rangschikken.}, year = {2003-2004} }Valid options are:
-S <num> Random number seed. (default 1)
-D If set, classifier is run in debug mode and may output additional info to the console
-C <CL|REG> Sets the classification type to be used. (Default: REG)
-A <MEAN|MED|MAX> Sets the averaging type used in phase 1 of the classifier. (Default: MEAN)
-N <NONE|EUCL|HAM> If different from NONE, a nearest neighbour rule is fired when the rule base doesn't contain an example smaller than the instance to be classified (Default: NONE).
-E <MIN|MAX|BOTH> Sets the extension type, i.e. the rule base to use. (Default: MIN)
-sort If set, the instances are also sorted within the same class before building the rule bases
Field Summary | |
---|---|
static int |
AT_MAXPROB
Use the mode for averaging in phase 1. |
static int |
AT_MEAN
Use the mean for averaging in phase 1. |
static int |
AT_MEDIAN
Use the median for averaging in phase 1. |
static int |
CT_REAL
No rounding is performed during classification, this is the classification is done in a regression like way. |
static int |
CT_ROUNDED
Round the real value that is returned by the original algorithm to the nearest label. |
static int |
DT_EUCLID
Use the Euclidian distance whenever a nearest neighbour rule is fired. |
static int |
DT_HAMMING
Use the Hamming distance, this is the number of positions in which the instances differ, whenever a nearest neighbour rule is fired |
static int |
DT_NONE
No nearest neighbour rule will be fired when classifying an instance for which there is no smaller rule in the rule base? |
static int |
ET_BOTH
Combine both the minimal and maximal extension, and use the midpoint of the resulting interval as prediction. |
static int |
ET_MAX
Use only the maximal extension. |
static int |
ET_MIN
Use only the minimal extension, as in the original algorithm of Ben-David. |
static Tag[] |
TAGS_AVERAGINGTYPES
the averaging types |
static Tag[] |
TAGS_CLASSIFICATIONTYPES
the classification types |
static Tag[] |
TAGS_DISTANCETYPES
the distance types |
static Tag[] |
TAGS_EXTENSIONTYPES
the mode types |
Constructor Summary | |
---|---|
OLM()
|
Method Summary | |
---|---|
java.lang.String |
averagingTypeTipText()
Returns the tip text for this property. |
void |
buildClassifier(Instances instances)
Build the OLM classifier, meaning that the rule bases are built. |
java.lang.String |
classificationTypeTipText()
Returns the tip text for this property. |
double |
classifyInstance(Instance instance)
Classifies a given instance according to the current settings of the classifier. |
java.lang.String |
distanceTypeTipText()
Returns the tip text for this property. |
java.lang.String |
extensionTypeTipText()
Returns the tip text for this property. |
SelectedTag |
getAveragingType()
Gets the averaging type. |
Capabilities |
getCapabilities()
Returns default capabilities of the classifier. |
SelectedTag |
getClassificationType()
Gets the classification type. |
SelectedTag |
getDistanceType()
Gets the distance type used by a nearest neighbour rule (if any). |
SelectedTag |
getExtensionType()
Gets the extension type. |
java.lang.String[] |
getOptions()
Gets an array of string with the current options of the classifier. |
int |
getSizeRuleBaseMax()
Return the number of examples in the maximal rule base. |
int |
getSizeRuleBaseMin()
Return the number of examples in the minimal rule base. |
boolean |
getSort()
Returns if the instances are sorted prior to building the rule bases. |
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 the classifier. |
java.util.Enumeration |
listOptions()
Get an enumeration of all available options for this classifier. |
static void |
main(java.lang.String[] args)
Main method for testing this class. |
java.lang.String |
seedTipText()
Returns the tip text for this property. |
void |
setAveragingType(SelectedTag value)
Sets the averaging type to use in phase 1 of the algorithm. |
void |
setClassificationType(SelectedTag value)
Sets the classification type. |
void |
setDistanceType(SelectedTag value)
Sets the distance type to be used by a nearest neighbour rule (if any). |
void |
setExtensionType(SelectedTag value)
Sets the extension type to use. |
void |
setOptions(java.lang.String[] options)
Parses the options for this object. |
void |
setSort(boolean sort)
Sets if the instances are to be sorted prior to building the rule bases. |
java.lang.String |
sortTipText()
Returns the tip text for this property. |
java.lang.String |
toString()
Returns a string description of the classifier. |
Methods inherited from class weka.classifiers.RandomizableClassifier |
---|
getSeed, setSeed |
Methods inherited from class weka.classifiers.Classifier |
---|
debugTipText, distributionForInstance, forName, getDebug, makeCopies, makeCopy, setDebug |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int CT_ROUNDED
public static final int CT_REAL
public static final Tag[] TAGS_CLASSIFICATIONTYPES
public static final int AT_MEAN
public static final int AT_MEDIAN
public static final int AT_MAXPROB
public static final Tag[] TAGS_AVERAGINGTYPES
public static final int DT_NONE
public static final int DT_EUCLID
public static final int DT_HAMMING
public static final Tag[] TAGS_DISTANCETYPES
public static final int ET_MIN
public static final int ET_MAX
public static final int ET_BOTH
public static final Tag[] TAGS_EXTENSIONTYPES
Constructor Detail |
---|
public OLM()
Method Detail |
---|
public java.lang.String globalInfo()
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Classifier
Capabilities
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public java.lang.String classificationTypeTipText()
public void setClassificationType(SelectedTag value)
value
- the classification type to be set.public SelectedTag getClassificationType()
public java.lang.String averagingTypeTipText()
public void setAveragingType(SelectedTag value)
value
- the averaging type to usepublic SelectedTag getAveragingType()
public java.lang.String distanceTypeTipText()
public void setDistanceType(SelectedTag value)
value
- the distance type to usepublic SelectedTag getDistanceType()
public java.lang.String extensionTypeTipText()
public void setExtensionType(SelectedTag value)
value
- the extension type to usepublic SelectedTag getExtensionType()
public java.lang.String sortTipText()
public void setSort(boolean sort)
sort
- if true
the instances will be sortedpublic boolean getSort()
true
if instances are sorted prior to building
the rule bases, false
otherwise.public java.lang.String seedTipText()
seedTipText
in class RandomizableClassifier
public int getSizeRuleBaseMin()
public int getSizeRuleBaseMax()
public double classifyInstance(Instance instance)
classifyInstance
in class Classifier
instance
- the instance to be classified
double
that represents the classification,
this could either be the internal value of a label, when rounding is
on, or a real number.public void buildClassifier(Instances instances) throws java.lang.Exception
buildClassifier
in class Classifier
instances
- the instances to use for building the rule base
java.lang.Exception
- if instances
cannot be handled by
the classifier.public java.lang.String toString()
toString
in class java.lang.Object
String
describing the classifier.public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class RandomizableClassifier
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-S <num> Random number seed. (default 1)
-D If set, classifier is run in debug mode and may output additional info to the console
-C <CL|REG> Sets the classification type to be used. (Default: REG)
-A <MEAN|MED|MAX> Sets the averaging type used in phase 1 of the classifier. (Default: MEAN)
-N <NONE|EUCL|HAM> If different from NONE, a nearest neighbour rule is fired when the rule base doesn't contain an example smaller than the instance to be classified (Default: NONE).
-E <MIN|MAX|BOTH> Sets the extension type, i.e. the rule base to use. (Default: MIN)
-sort If set, the instances are also sorted within the same class before building the rule bases
setOptions
in interface OptionHandler
setOptions
in class RandomizableClassifier
options
- an array of strings containing the options
java.lang.Exception
- if there are options that have invalid arguments.public java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class RandomizableClassifier
setOptions
public static void main(java.lang.String[] args)
args
- the command line arguments
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |