public class MINND
extends weka.classifiers.AbstractClassifier
implements weka.core.OptionHandler, weka.core.MultiInstanceCapabilitiesHandler, weka.core.TechnicalInformationHandler
@misc{Xu2001, address = {Hamilton, NZ}, author = {Xin Xu}, note = {0657.591B}, school = {University of Waikato}, title = {A nearest distribution approach to multiple-instance learning}, year = {2001} }Valid options are:
-K <number of neighbours> Set number of nearest neighbour for prediction (default 1)
-S <number of neighbours> Set number of nearest neighbour for cleansing the training data (default 1)
-E <number of neighbours> Set number of nearest neighbour for cleansing the testing data (default 1)
Constructor and Description |
---|
MINND() |
Modifier and Type | Method and Description |
---|---|
void |
buildClassifier(weka.core.Instances exs)
As normal Nearest Neighbour algorithm does, it's lazy and simply records
the exemplar information (i.e.
|
double |
classifyInstance(weka.core.Instance ex)
Use Kullback Leibler distance to find the nearest neighbours of the given
exemplar.
|
weka.core.Instance |
cleanse(weka.core.Instance before)
Cleanse the given exemplar according to the valid and noise data statistics
|
void |
findWeights(int row,
double[][] mean)
Use gradient descent to distort the MU parameter for the exemplar.
|
weka.core.Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
weka.core.Capabilities |
getMultiInstanceCapabilities()
Returns the capabilities of this multi-instance classifier for the
relational data.
|
int |
getNumNeighbours()
Returns the number of nearest neighbours to estimate the class prediction
of tests bags
|
int |
getNumTestingNoises()
Returns The number of nearest neighbour instances in the selection of
noises in the test data
|
int |
getNumTrainingNoises()
Returns the number of nearest neighbour instances in the selection of
noises in the training data
|
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier.
|
java.lang.String |
getRevision()
Returns the revision string.
|
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 this filter
|
double |
kullback(double[] mu1,
double[] mu2,
double[] var1,
double[] var2,
int pos)
This function calculates the Kullback Leibler distance between two normal
distributions.
|
java.util.Enumeration<weka.core.Option> |
listOptions()
Returns an enumeration describing the available options
|
static void |
main(java.lang.String[] args)
Main method for testing.
|
java.lang.String |
numNeighboursTipText()
Returns the tip text for this property
|
java.lang.String |
numTestingNoisesTipText()
Returns the tip text for this property
|
java.lang.String |
numTrainingNoisesTipText()
Returns the tip text for this property
|
weka.core.Instance |
preprocess(weka.core.Instances data,
int pos)
Pre-process the given exemplar according to the other exemplars in the
given exemplars.
|
void |
setNumNeighbours(int numNeighbour)
Sets the number of nearest neighbours to estimate the class prediction of
tests bags
|
void |
setNumTestingNoises(int numTesting)
Sets The number of nearest neighbour exemplars in the selection of noises
in the test data
|
void |
setNumTrainingNoises(int numTraining)
Sets the number of nearest neighbour instances in the selection of noises
in the training data
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
double |
target(double[] x,
double[][] X,
int rowpos,
double[] Y)
Compute the target function to minimize in gradient descent The formula is:
1/2*sum[i=1..p](f(X, Xi)-var(Y, Yi))^2 where p is the number of exemplars and Y is the class label. |
batchSizeTipText, debugTipText, distributionForInstance, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
public java.lang.String globalInfo()
public weka.core.TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface weka.core.TechnicalInformationHandler
public weka.core.Capabilities getCapabilities()
getCapabilities
in interface weka.classifiers.Classifier
getCapabilities
in interface weka.core.CapabilitiesHandler
getCapabilities
in class weka.classifiers.AbstractClassifier
public weka.core.Capabilities getMultiInstanceCapabilities()
getMultiInstanceCapabilities
in interface weka.core.MultiInstanceCapabilitiesHandler
Capabilities
public void buildClassifier(weka.core.Instances exs) throws java.lang.Exception
buildClassifier
in interface weka.classifiers.Classifier
exs
- the training exemplarsjava.lang.Exception
- if the model cannot be built properlypublic weka.core.Instance preprocess(weka.core.Instances data, int pos) throws java.lang.Exception
data
- the whole exemplarspos
- the position of given exemplar in datajava.lang.Exception
- if the returned exemplar is wrongpublic void findWeights(int row, double[][] mean)
row
- the given row indexmean
- public double target(double[] x, double[][] X, int rowpos, double[] Y)
x
- the weights of the exemplar in questionrowpos
- row index of x in XY
- the observed class labelpublic double classifyInstance(weka.core.Instance ex) throws java.lang.Exception
classifyInstance
in interface weka.classifiers.Classifier
classifyInstance
in class weka.classifiers.AbstractClassifier
ex
- the given test exemplarjava.lang.Exception
- if the exemplar could not be classified successfullypublic weka.core.Instance cleanse(weka.core.Instance before) throws java.lang.Exception
before
- the given exemplarjava.lang.Exception
- if the returned exemplar is wrongpublic double kullback(double[] mu1, double[] mu2, double[] var1, double[] var2, int pos)
mu1
- mu of the first normal distributionmu2
- mu of the second normal distributionvar1
- variance(SIGMA^2) of the first normal distributionvar2
- variance(SIGMA^2) of the second normal distributionpublic java.util.Enumeration<weka.core.Option> listOptions()
listOptions
in interface weka.core.OptionHandler
listOptions
in class weka.classifiers.AbstractClassifier
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-K <number of neighbours> Set number of nearest neighbour for prediction (default 1)
-S <number of neighbours> Set number of nearest neighbour for cleansing the training data (default 1)
-E <number of neighbours> Set number of nearest neighbour for cleansing the testing data (default 1)
setOptions
in interface weka.core.OptionHandler
setOptions
in class weka.classifiers.AbstractClassifier
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
getOptions
in class weka.classifiers.AbstractClassifier
public java.lang.String numNeighboursTipText()
public void setNumNeighbours(int numNeighbour)
numNeighbour
- the number of citerspublic int getNumNeighbours()
public java.lang.String numTrainingNoisesTipText()
public void setNumTrainingNoises(int numTraining)
numTraining
- the number of noises in training datapublic int getNumTrainingNoises()
public java.lang.String numTestingNoisesTipText()
public int getNumTestingNoises()
public void setNumTestingNoises(int numTesting)
numTesting
- the number of noises in test datapublic java.lang.String getRevision()
getRevision
in interface weka.core.RevisionHandler
getRevision
in class weka.classifiers.AbstractClassifier
public static void main(java.lang.String[] args)
args
- the options for the classifier