public class ENN
extends weka.filters.Filter
implements weka.filters.UnsupervisedFilter, weka.core.OptionHandler
-N <num> Specify the ENN over-sampling factor (default 1)
-K <num> Specify the factor of nearest neighbors for each minority class sample (default 2)
-I Inverts percent values for minority classes
-P <num> Specify a percent value to decide when a class is a minority class (default 50)
Modifier and Type | Class and Description |
---|---|
class |
ENN.LinearNNSearchENN |
Constructor and Description |
---|
ENN() |
Modifier and Type | Method and Description |
---|---|
boolean |
batchFinished()
Signify that this batch of input to the filter is finished.
|
weka.core.Capabilities |
getCapabilities()
Returns the Capabilities of this filter.
|
int |
getKNeighborsFactor()
Gets the factor of nearest neighbors for each minority class sample
|
java.lang.String[] |
getOptions()
Gets the current settings of the filter.
|
int |
getRandomSeed()
Gets the random number seed.
|
java.lang.String |
globalInfo()
Returns a string describing this classifier
|
boolean |
input(weka.core.Instance instance)
Input an instance for filtering.
|
java.lang.String |
KNeighborsFactorTipText()
Returns the tip text for this property
|
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] args)
Main method for testing this class.
|
java.lang.String |
randomSeedTipText()
Returns the tip text for this property
|
static void |
runFilter(weka.filters.Filter filter,
java.lang.String[] options)
runs the filter instance with the given options.
|
boolean |
setInputFormat(weka.core.Instances instanceInfo)
Sets the format of the input instances.
|
void |
setKNeighborsFactor(int nNeighbors)
Sets the factor of nearest neighbors for each minority class sample
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setRandomSeed(int newSeed)
Sets the random number seed.
|
batchFilterFile, filterFile, getCapabilities, getOutputFormat, getRevision, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputPeek, toString, useFilter, wekaStaticWrapper
public java.lang.String globalInfo()
public java.util.Enumeration listOptions()
listOptions
in interface weka.core.OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-K <num> Specify the factor of nearest neighbors for each minority class sample (default 2)
setOptions
in interface weka.core.OptionHandler
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface weka.core.OptionHandler
public java.lang.String randomSeedTipText()
public int getRandomSeed()
public void setRandomSeed(int newSeed)
newSeed
- the new random number seed.public java.lang.String KNeighborsFactorTipText()
public int getKNeighborsFactor()
public void setKNeighborsFactor(int nNeighbors)
nKNF
- factor of nearest neighbors for each minority class samplepublic weka.core.Capabilities getCapabilities()
getCapabilities
in interface weka.core.CapabilitiesHandler
getCapabilities
in class weka.filters.Filter
Capabilities
public boolean setInputFormat(weka.core.Instances instanceInfo) throws java.lang.Exception
setInputFormat
in class weka.filters.Filter
instanceInfo
- an Instances object containing the input
instance structure (any instances contained in the object are
ignored - only the structure is required).java.lang.IllegalArgumentException
- if the input format can't be set
successfullyjava.lang.Exception
- if the inputFormat can't be set successfullypublic boolean input(weka.core.Instance instance)
input
in class weka.filters.Filter
instance
- the input instancejava.lang.IllegalStateException
- if no input structure has been definedpublic boolean batchFinished()
batchFinished
in class weka.filters.Filter
java.lang.IllegalStateException
- if no input structure has been definedpublic static void runFilter(weka.filters.Filter filter, java.lang.String[] options)
filter
- the filter to runoptions
- the command line optionspublic static void main(java.lang.String[] args)
args
- should contain arguments to the filter: use -h for help