public class SOMLibDataWinnerMapping
extends java.lang.Object
SmoothedDataHistograms
in their weighted & normalised form.Modifier and Type | Class and Description |
---|---|
private class |
SOMLibDataWinnerMapping.DataInformation
Inner class holding the list of a certain number of best-matching units for an certain input datum.
|
Modifier and Type | Field and Description |
---|---|
private SOMLibDataWinnerMapping.DataInformation[] |
dataInfo |
private boolean |
is3D |
private boolean |
is3Dcached |
static int |
MAX_DATA_WINNERS
Maximum data winners that will be written per unit, unless specified otherwise.
|
private java.lang.String |
metric |
private int |
numBMUs |
private int |
numVectors |
Modifier | Constructor and Description |
---|---|
private |
SOMLibDataWinnerMapping() |
|
SOMLibDataWinnerMapping(java.lang.String fileName)
Sole constructor taking the name of the data-winner mapping file as an argument.
|
Modifier and Type | Method and Description |
---|---|
SOMLibDataWinnerMapping |
clone() |
void |
flipH(int ySize)
Flip around the horizontal axis
|
void |
flipV(int xSize)
Flip around the vertical axis
|
double[] |
getDists(int datum)
Returns an array of
double values containing the distances between the input datum and the
best-matching units sorted ascending. |
static java.lang.String |
getFileNameSuffix() |
SOMLibDataWinnerMapping.DataInformation[] |
getInternalDataRepresentationCopy() |
java.lang.String[] |
getLabels() |
java.lang.String |
getMetric() |
int |
getNumBMUs()
Returns the number of best-matching units per input datum.
|
int |
getNumVectors()
Returns the number of input vectors.
|
int |
getVectPos(java.lang.String label)
Finds the position of input vector by comparing its label.
|
int[] |
getXPos(int datum)
Returns an array of
int values containing the horizontal positions of the the best-matching units of
the input datum. |
int[] |
getYPos(int datum)
Returns an array of
int values containing the vertical positions of the the best-matching units of
the input datum. |
int[] |
getZPos(int datum)
Returns an array of
int values containing the depth positions of the the best-matching units of the
input datum. |
boolean |
is3D() |
static void |
main(java.lang.String[] args) |
void |
readDataWinnerMappingFile(java.lang.String fileName)
Reads from the file and fills the data structure.
|
void |
rotate(int quadrants,
int xSize,
int ySize)
Rotate the winner mapping.
|
public static final int MAX_DATA_WINNERS
private SOMLibDataWinnerMapping.DataInformation[] dataInfo
private int numBMUs
private int numVectors
private java.lang.String metric
private boolean is3D
private boolean is3Dcached
public SOMLibDataWinnerMapping(java.lang.String fileName) throws java.io.FileNotFoundException, SOMLibFileFormatException
fileName
- the name of the data-winner mapping file.java.io.FileNotFoundException
- if the file with the given name is not found.SOMLibFileFormatException
- if the format of the file is corrupt.private SOMLibDataWinnerMapping()
public double[] getDists(int datum)
double
values containing the distances between the input datum and the
best-matching units sorted ascending. If the argument datum
is invalid, an
ArrayIndexOutOfBoundsException
will be thrown. The calling function is not obliged to catch it.datum
- the index of the input datum in the list.public int getNumBMUs()
public int getNumVectors()
public int[] getXPos(int datum)
int
values containing the horizontal positions of the the best-matching units of
the input datum. If the argument datum
is invalid, an ArrayIndexOutOfBoundsException
will be thrown. The calling function is not obliged to catch it.datum
- the index of the input datum in the list.int
values containing the horizontal positions of the the best-matching units of
the input datum.public int[] getYPos(int datum)
int
values containing the vertical positions of the the best-matching units of
the input datum. If the argument datum
is invalid, an ArrayIndexOutOfBoundsException
will be thrown. The calling function is not obliged to catch it.datum
- the index of the input datum in the list.int
values containing the vertical positions of the the best-matching units of
the input datum.public int[] getZPos(int datum)
int
values containing the depth positions of the the best-matching units of the
input datum. If the argument datum
is invalid, an ArrayIndexOutOfBoundsException
will
be thrown. The calling function is not obliged to catch it.datum
- the index of the input datum in the list.int
values containing the depth positions of the the best-matching units of the
input datum.public java.lang.String[] getLabels()
public int getVectPos(java.lang.String label) throws SOMToolboxException
label
- The label of the input vectorSOMToolboxException
- when label is not found in data winner mapping filepublic void readDataWinnerMappingFile(java.lang.String fileName) throws java.io.FileNotFoundException, SOMLibFileFormatException
fileName
- the name of the file to open.java.io.FileNotFoundException
- if the file with the given name is not found.SOMLibFileFormatException
- if the format of the file is corrupt.public boolean is3D()
public java.lang.String getMetric()
public SOMLibDataWinnerMapping clone()
clone
in class java.lang.Object
public void rotate(int quadrants, int xSize, int ySize)
quadrants
- rotate the winners for quadrants x 90
degrees (clockwise)public void flipH(int ySize)
public void flipV(int xSize)
public SOMLibDataWinnerMapping.DataInformation[] getInternalDataRepresentationCopy()
public static java.lang.String getFileNameSuffix()
public static void main(java.lang.String[] args)