at.tuwien.ifs.somtoolbox.visualization.comparison
Class SOMComparison

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.visualization.comparison.SOMComparison

public class SOMComparison
extends Object

Version:
$Id: SOMComparison.java 3590 2010-05-21 10:43:45Z mayer $
Author:
Doris Baum

Field Summary
private  boolean absolute
           
private  int clusterNo
           
private  LabelCoordinates[] coords1
           
private  LabelCoordinates[] coords2
           
private  double[][] dist1
           
private  double[][] dist2
           
private  GrowingSOM gsom1
           
private  GrowingSOM gsom2
           
private  String[] labelList1
           
private  String[] labelList2
           
 int MAXCLUSTERNO
           
private  int maxCount
           
private  double maxDistance
           
private  int minAbsoluteCount
           
private  boolean multiMatch
           
private  int outlierCountThreshold
           
private  double outlierPercentThreshold
           
private  double sourceThreshold
           
private  int stableCountThreshold
           
private  double stablePercentThreshold
           
private  double targetThreshold
           
 
Constructor Summary
SOMComparison()
           
 
Method Summary
static int[][] calculateClusterAssignment(GrowingSOM gsom, int level)
          Assigns each unit in the grid a number for the cluster it belongs to
static double[][] calculateClusterDistances(int[][] clusterAssig, int clusterNo)
           
 ArrayList<Shift> calculateClusterShifts(MapPNode map1, MapPNode map2)
           
 void calculateMatrices()
           
 ArrayList<Shift> calculateShifts(boolean cumulative)
           
static double[][] calculcateIntraSOMClusterDistanceMatrix(LabelCoordinates[] coords, int[][] secSOMClusterAssignment, int clusterNo, double[][] distances)
          Calculate the cluster distance matrix for all mapped vectors from the information where the inputs are mapped
static double[][] calculcateIntraSOMDistanceMatrix(LabelCoordinates[] coords)
          Calculate the distance matrix for all mapped vectors from the information where the inputs are mapped
 int[] clusterEquivalent(int[][] assignment1, int[][] assignment2, LabelCoordinates[] coords1, LabelCoordinates[] coords2, int numberOfClusters, double[] percentages)
           
private  LabelCoordinates getClusterMeanPoint(int[][] assignment, int y, int x, GrowingSOM gsom)
          Try to find a mean-point for a cluster
 int getClusterNo()
           
static LabelCoordinates[] getLabelCoordinates(GrowingSOM gsom)
           
 int getMaxCount()
          Compare two SOMs according to where input vectors come to lie on the map
 double getMaxDistance()
           
 int getMinAbsoluteCount()
           
 int getOutlierCountThreshold()
           
 double getOutlierPercentThreshold()
           
 double getSourceThreshold()
           
 int getStableCountThreshold()
           
 double getStablePercentThreshold()
           
 double gettargetThreshold()
           
 double getTargetThreshold()
           
private  int highestCount(int[] neighbourCount)
           
 boolean isAbsolute()
           
 boolean isMultiMatch()
           
static GrowingSOM loadGSOM(String setname)
           
 void loadGSOMs(GrowingSOM gsom, String prefix)
           
 void loadGSOMsFromPrefix(String prefix1, String prefix2)
           
static void printInputDifferenceErrorMesage(String[] labelList, String[] labelList2)
           
private  ArrayList<Shift> purgeShifts(ArrayList<Shift> allshifts)
           
 void setAbsolute(boolean absolute)
           
 void setClusterNo(int clusterNo)
           
 void setMinAbsoluteCount(int minAbsoluteCount)
           
 void setMultiMatch(boolean multiMatch)
           
 void setOutlierCountThreshold(int outlierCountThreshold)
           
 void setOutlierPercentThreshold(double outlierPercentThreshold)
           
 void setSourceThreshold(double sourceThreshold)
           
 void setStableCountThreshold(int stableCountThreshold)
           
 void setStablePercentThreshold(double stablePercentThreshold)
           
 void settargetThreshold(double targetThreshold)
           
 void setTargetThreshold(double targetThreshold)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gsom1

private GrowingSOM gsom1

gsom2

private GrowingSOM gsom2

coords1

private LabelCoordinates[] coords1

coords2

private LabelCoordinates[] coords2

labelList1

private String[] labelList1

labelList2

private String[] labelList2

dist1

private double[][] dist1

dist2

private double[][] dist2

maxDistance

private double maxDistance

maxCount

private int maxCount

sourceThreshold

private double sourceThreshold

targetThreshold

private double targetThreshold

outlierCountThreshold

private int outlierCountThreshold

stableCountThreshold

private int stableCountThreshold

outlierPercentThreshold

private double outlierPercentThreshold

stablePercentThreshold

private double stablePercentThreshold

minAbsoluteCount

private int minAbsoluteCount

absolute

private boolean absolute

multiMatch

private boolean multiMatch

clusterNo

private int clusterNo

MAXCLUSTERNO

public final int MAXCLUSTERNO
See Also:
Constant Field Values
Constructor Detail

SOMComparison

public SOMComparison()
Method Detail

getLabelCoordinates

public static LabelCoordinates[] getLabelCoordinates(GrowingSOM gsom)

loadGSOM

public static GrowingSOM loadGSOM(String setname)

calculcateIntraSOMDistanceMatrix

public static double[][] calculcateIntraSOMDistanceMatrix(LabelCoordinates[] coords)
                                                   throws MetricException
Calculate the distance matrix for all mapped vectors from the information where the inputs are mapped

Throws:
MetricException

calculateClusterDistances

public static double[][] calculateClusterDistances(int[][] clusterAssig,
                                                   int clusterNo)

calculateClusterAssignment

public static int[][] calculateClusterAssignment(GrowingSOM gsom,
                                                 int level)
                                          throws LayerAccessException,
                                                 ClusteringAbortedException
Assigns each unit in the grid a number for the cluster it belongs to

Throws:
LayerAccessException
ClusteringAbortedException

clusterEquivalent

public int[] clusterEquivalent(int[][] assignment1,
                               int[][] assignment2,
                               LabelCoordinates[] coords1,
                               LabelCoordinates[] coords2,
                               int numberOfClusters,
                               double[] percentages)

calculcateIntraSOMClusterDistanceMatrix

public static double[][] calculcateIntraSOMClusterDistanceMatrix(LabelCoordinates[] coords,
                                                                 int[][] secSOMClusterAssignment,
                                                                 int clusterNo,
                                                                 double[][] distances)
Calculate the cluster distance matrix for all mapped vectors from the information where the inputs are mapped


highestCount

private int highestCount(int[] neighbourCount)

calculateShifts

public ArrayList<Shift> calculateShifts(boolean cumulative)
                                 throws SOMToolboxException
Throws:
SOMToolboxException

purgeShifts

private ArrayList<Shift> purgeShifts(ArrayList<Shift> allshifts)

calculateClusterShifts

public ArrayList<Shift> calculateClusterShifts(MapPNode map1,
                                               MapPNode map2)
                                        throws ClusteringAbortedException
Throws:
ClusteringAbortedException

getClusterMeanPoint

private LabelCoordinates getClusterMeanPoint(int[][] assignment,
                                             int y,
                                             int x,
                                             GrowingSOM gsom)
Try to find a mean-point for a cluster


loadGSOMsFromPrefix

public void loadGSOMsFromPrefix(String prefix1,
                                String prefix2)
                         throws SOMToolboxException
Throws:
SOMToolboxException

loadGSOMs

public void loadGSOMs(GrowingSOM gsom,
                      String prefix)
               throws SOMToolboxException
Throws:
SOMToolboxException

calculateMatrices

public void calculateMatrices()

getMaxCount

public int getMaxCount()
Compare two SOMs according to where input vectors come to lie on the map


getMaxDistance

public double getMaxDistance()

gettargetThreshold

public double gettargetThreshold()

settargetThreshold

public void settargetThreshold(double targetThreshold)

getOutlierCountThreshold

public int getOutlierCountThreshold()

getStableCountThreshold

public int getStableCountThreshold()

getTargetThreshold

public double getTargetThreshold()

setOutlierCountThreshold

public void setOutlierCountThreshold(int outlierCountThreshold)

setStableCountThreshold

public void setStableCountThreshold(int stableCountThreshold)

setTargetThreshold

public void setTargetThreshold(double targetThreshold)

getClusterNo

public int getClusterNo()

setClusterNo

public void setClusterNo(int clusterNo)

getSourceThreshold

public double getSourceThreshold()

setSourceThreshold

public void setSourceThreshold(double sourceThreshold)

getOutlierPercentThreshold

public double getOutlierPercentThreshold()

setOutlierPercentThreshold

public void setOutlierPercentThreshold(double outlierPercentThreshold)

getStablePercentThreshold

public double getStablePercentThreshold()

setStablePercentThreshold

public void setStablePercentThreshold(double stablePercentThreshold)

isAbsolute

public boolean isAbsolute()

setAbsolute

public void setAbsolute(boolean absolute)

getMinAbsoluteCount

public int getMinAbsoluteCount()

setMinAbsoluteCount

public void setMinAbsoluteCount(int minAbsoluteCount)

printInputDifferenceErrorMesage

public static void printInputDifferenceErrorMesage(String[] labelList,
                                                   String[] labelList2)

setMultiMatch

public void setMultiMatch(boolean multiMatch)

isMultiMatch

public boolean isMultiMatch()