public class SelfOrganizingMap extends AbstractClusterer implements OptionHandler
-L < initial learning rate> The initial learning rate for the training algorithm. (Value should be greater than 0.01 and less or equal to 1, Default = 1).
-O <number of epochs in ordering phase> Number of epochs in ordering phase. (Value should be greater than or equal to 2000, Default = 2000).
-C <number of epochs in convergence phase> Number of epochs to train through. (Value should be greater than or equal to 1000, Default = 1000).
-H <height of lattice> The height of lattice. (Value should be > 0, Default = 1).
-W <width of lattice> The width of lattice. (Value should be > 0, Default = 1).
-I Normalizing the attributes will NOT be done. (Set this to not normalize the attributes).
-S Statistics will NOT be calculated after training. (Set this to not calculate statistics).
Constructor and Description |
---|
SelfOrganizingMap()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
buildClusterer(Instances data)
Generates a clusterer.
|
java.lang.String |
calcStatsTipText() |
int |
clusterInstance(Instance i)
Classifies a given instance.
|
java.lang.String |
convergenceEpochsTipText() |
boolean |
getCalcStats() |
Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
Instances[] |
getClusterInstances()
This function returns the cluster assignment for each of the
training instances.
|
Instances |
getClusters()
This function returns the clusters if the clusterer is build
or an exception if the clusterer is not build.
|
int |
getConvergenceEpochs() |
int |
getHeight() |
double |
getLearningRate() |
boolean |
getNormalizeAttributes() |
java.lang.String[] |
getOptions()
Gets the current settings of NeuralNet.
|
int |
getOrderingEpochs() |
java.lang.String |
getRevision()
Returns the revision string.
|
double[][][] |
getStatistics()
This function returns the training statistics in a 3-dimension array
as follows:
First dimension: the attribute index Second dimension: the cluster index Third dimension: the static index (Valid values are 0: min, 1: max, 2: mean, 3: st. |
int |
getWidth() |
java.lang.String |
globalInfo()
This will return a string describing the clusterer.
|
java.lang.String |
heightTipText() |
java.lang.String |
learningRateTipText() |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
java.lang.String |
normalizeAttributesTipText() |
int |
numberOfClusters()
Returns the number of clusters.
|
java.lang.String |
orderingEpochsTipText() |
void |
setCalcStats(boolean c) |
void |
setConvergenceEpochs(int n)
Set the number of epochs in convergence phase.
|
void |
setHeight(int height)
Sets the height of lattice.
|
void |
setLearningRate(double l)
The initial learning rate can be set using this command.
|
void |
setNormalizeAttributes(boolean a) |
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setOrderingEpochs(int n)
Set the number of epochs in ordering phase.
|
void |
setWidth(int width)
Sets the width of lattice.
|
java.lang.String |
toString()
return a string describing this clusterer.
|
java.lang.String |
widthTipText() |
distributionForInstance, forName, makeCopies, makeCopy, runClusterer
public int getWidth()
public void setWidth(int width)
width
- The width of lattice.public int getHeight()
public void setHeight(int height)
height
- The height.public int getConvergenceEpochs()
public void setConvergenceEpochs(int n)
n
- The number of epochs.public int getOrderingEpochs()
public void setOrderingEpochs(int n)
n
- The number of epochs.public double getLearningRate()
public void setLearningRate(double l)
l
- The initial learning rate.public boolean getNormalizeAttributes()
public void setNormalizeAttributes(boolean a)
a
- True if the attributes should be normalized (even nominal
attributes will get normalized here) (range goes between -1 - 1).public boolean getCalcStats()
public void setCalcStats(boolean c)
c
- True if statistics should be calculated.public java.lang.String heightTipText()
public java.lang.String calcStatsTipText()
public java.lang.String widthTipText()
public java.lang.String learningRateTipText()
public java.lang.String convergenceEpochsTipText()
public java.lang.String orderingEpochsTipText()
public java.lang.String normalizeAttributesTipText()
public java.lang.String globalInfo()
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClusterer
public Capabilities getCapabilities()
getCapabilities
in interface Clusterer
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class AbstractClusterer
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-L <initial learning rate> The initial learning rate for the training algorithm. (Value should be greater than 0.01 and less or equal to 1, Default = 1).
-O <number of epochs in ordering phase> Number of epochs in ordering phase. (Value should be greater than or equal to 2000, Default = 2000).
-C <number of epochs in convergence phase> Number of epochs in convergence phase. (Value should be greater than or equal to 1000, Default = 1000).
-I Normalizing the attributes will NOT be done. (Set this to not normalize the attributes).
-H <height of lattice> The height of lattice. (Value should be > 0, Default = 2).
-W <width of lattice> The width of lattice. (Value should be > 0, Default = 2).
-S Statistics will NOT be calculated after training. (Set this to not calculate statistics).
setOptions
in interface 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 OptionHandler
public int clusterInstance(Instance i) throws java.lang.Exception
clusterInstance
in interface Clusterer
clusterInstance
in class AbstractClusterer
i
- the instance to be assigned to a clusterjava.lang.Exception
- if instance could not be classified
successfullypublic java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public java.lang.String toString()
toString
in class java.lang.Object
public void buildClusterer(Instances data) throws java.lang.Exception
buildClusterer
in interface Clusterer
buildClusterer
in class AbstractClusterer
data
- set of instances serving as training datajava.lang.Exception
- if the clusterer has not been
generated successfullypublic int numberOfClusters() throws java.lang.Exception
numberOfClusters
in interface Clusterer
numberOfClusters
in class AbstractClusterer
java.lang.Exception
- if number of clusters could not be returned
successfullypublic Instances getClusters() throws java.lang.Exception
java.lang.Exception
public double[][][] getStatistics() throws java.lang.Exception
java.lang.Exception
public Instances[] getClusterInstances() throws java.lang.Exception
java.lang.Exception