public class ClassOrder extends Filter implements SupervisedFilter, OptionHandler
-R <seed> Specify the seed of randomization used to randomize the class order (default: 1)
-C <order> Specify the class order to be sorted, could be 0: ascending 1: descending and 2: random.(default: 0)
| Modifier and Type | Field and Description |
|---|---|
static int |
FREQ_ASCEND
The class values are sorted in ascending order based on their frequencies
|
static int |
FREQ_DESCEND
The class values are sorted in descending order based on their frequencies
|
static int |
RANDOM
The class values are sorted in random order
|
| Constructor and Description |
|---|
ClassOrder() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
batchFinished()
Signify that this batch of input to the filter is finished.
|
String |
classOrderTipText()
Returns the tip text for this property
|
double[] |
distributionsByOriginalIndex(double[] before)
Convert the given class distribution back to the distributions with the
original internal class index
|
Capabilities |
getCapabilities()
Returns the Capabilities of this filter.
|
double[] |
getClassCounts()
Get the class distribution of the sorted class values.
|
int |
getClassOrder()
Get the wanted class order
|
String[] |
getOptions()
Gets the current settings of the filter.
|
String |
getRevision()
Returns the revision string.
|
long |
getSeed()
Get the current randomization seed
|
String |
globalInfo()
Returns a string describing this filter
|
boolean |
input(Instance instance)
Input an instance for filtering.
|
Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] argv)
Main method for testing this class.
|
double |
originalValue(double value)
Return the original internal class value given the randomized class value,
i.e.
|
String |
seedTipText()
Returns the tip text for this property
|
void |
setClassOrder(int order)
Set the wanted class order
|
boolean |
setInputFormat(Instances instanceInfo)
Sets the format of the input instances.
|
void |
setOptions(String[] options)
Parses a given list of options.
|
void |
setSeed(long seed)
Set randomization seed
|
batchFilterFile, debugTipText, doNotCheckCapabilitiesTipText, filterFile, getCapabilities, getDebug, getDoNotCheckCapabilities, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputPeek, postExecution, preExecution, run, runFilter, setDebug, setDoNotCheckCapabilities, toString, useFilter, wekaStaticWrapperpublic static final int FREQ_ASCEND
public static final int FREQ_DESCEND
public static final int RANDOM
public String globalInfo()
public Enumeration<Option> listOptions()
listOptions in interface OptionHandlerlistOptions in class Filterpublic void setOptions(String[] options) throws Exception
-R <seed> Specify the seed of randomization used to randomize the class order (default: 1)
-C <order> Specify the class order to be sorted, could be 0: ascending 1: descending and 2: random.(default: 0)
setOptions in interface OptionHandlersetOptions in class Filteroptions - the list of options as an array of stringsException - if an option is not supportedpublic String[] getOptions()
getOptions in interface OptionHandlergetOptions in class Filterpublic String seedTipText()
public long getSeed()
public void setSeed(long seed)
seed - the set seedpublic String classOrderTipText()
public int getClassOrder()
public void setClassOrder(int order)
order - the class orderpublic Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class FilterCapabilitiespublic boolean setInputFormat(Instances instanceInfo) throws Exception
setInputFormat in class FilterinstanceInfo - an Instances object containing the input instance
structure (any instances contained in the object are ignored -
only the structure is required).Exception - if no class index set or class not nominalpublic boolean input(Instance instance)
input in class Filterinstance - the input instanceIllegalStateException - if no input format has been defined.public boolean batchFinished()
throws Exception
batchFinished in class FilterIllegalStateException - if no input structure has been defined,Exception - if there was a problem finishing the batch.public double[] getClassCounts()
public double[] distributionsByOriginalIndex(double[] before)
before - the given class distributionpublic double originalValue(double value)
throws Exception
value - the given valueException - if the coverter table is not set yetpublic String getRevision()
getRevision in interface RevisionHandlergetRevision in class Filterpublic static void main(String[] argv)
argv - should contain arguments to the filter: use -h for helpCopyright © 2016 University of Waikato, Hamilton, NZ. All Rights Reserved.