relational.types
Class BipartGraph

java.lang.Object
  extended byedu.uci.ics.jung.utils.UserData
      extended byedu.uci.ics.jung.graph.impl.AbstractArchetypeGraph
          extended byedu.uci.ics.jung.graph.impl.AbstractSparseGraph
              extended byedu.uci.ics.jung.graph.impl.SparseGraph
                  extended byedu.uci.ics.jung.graph.impl.UndirectedSparseGraph
                      extended byedu.uci.ics.jung.graph.impl.BipartiteGraph
                          extended byrelational.types.BipartGraph
All Implemented Interfaces:
edu.uci.ics.jung.graph.ArchetypeGraph, java.lang.Cloneable, edu.uci.ics.jung.graph.Graph, edu.uci.ics.jung.graph.UndirectedGraph, edu.uci.ics.jung.utils.UserDataContainer

public class BipartGraph
extends edu.uci.ics.jung.graph.impl.BipartiteGraph

Builds a bipartite Graph and contains methods for calculation of divers graph properties.


Nested Class Summary
 
Nested classes inherited from class edu.uci.ics.jung.graph.impl.BipartiteGraph
edu.uci.ics.jung.graph.impl.BipartiteGraph.Choice
 
Nested classes inherited from class edu.uci.ics.jung.utils.UserDataContainer
edu.uci.ics.jung.utils.UserDataContainer.CopyAction
 
Field Summary
 java.util.HashMap newNeighbors
           
 
Fields inherited from class edu.uci.ics.jung.graph.impl.BipartiteGraph
BIPARTITE_USER_TAG, CLASSA, CLASSB
 
Fields inherited from class edu.uci.ics.jung.utils.UserData
CLONE, REMOVE, SHARED
 
Fields inherited from interface edu.uci.ics.jung.graph.Graph
DIRECTED_EDGE, NOT_PARALLEL_EDGE, SIMPLE_EDGE, UNDIRECTED_EDGE
 
Fields inherited from interface edu.uci.ics.jung.graph.ArchetypeGraph
SUBSET_MANAGER
 
Constructor Summary
BipartGraph(java.util.HashMap labels)
           
 
Method Summary
 double averageNumNeighbors()
          Calculates avarage number of neighbors
 java.util.HashMap countNeighborsClassesMultiLabelTest(weka.core.FastVector items, int klasse, java.util.HashMap initial, java.util.HashMap weightsMap, java.util.HashMap nodes)
          Counts the frequency of the categories of neighbors of an instance (for binary classification)
 java.util.HashMap countNeighborsClassesMultiLabelTrain(weka.core.FastVector items, java.util.HashMap initial, java.util.HashMap weightsMap, java.util.HashMap nodes)
          Counts the frequency of the categories of neighbors of an instance (for binary classification)
 java.util.HashMap countNeighborsClassesTest(weka.core.FastVector items, java.util.HashMap initial, java.util.HashMap weightsMap, java.util.HashMap nodes)
          Counts the frequency of the categories of neighbors of an instance
 java.util.HashMap countNeighborsClassesTrain(weka.core.FastVector items, java.util.HashMap initial, java.util.HashMap weightsMap, java.util.HashMap nodes)
          Counts the frequency of the categories of neighbors of an instance
 java.util.HashMap getSingletons(weka.core.FastVector items, java.util.HashMap nodes)
          Get the nodes without any neighbors
static void main(java.lang.String[] args)
           
 double maxNumNeighbors()
          Calculates the maximum number of neighbors in the graph
 
Methods inherited from class edu.uci.ics.jung.graph.impl.BipartiteGraph
addBipartiteEdge, addEdge, addVertex, addVertex, fold, getAllVertices, getPartition, initialize, removeVertex
 
Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractSparseGraph
getEdges, getVertices, isDirected, removeAllEdges, removeAllVertices, removeEdge, removeEdges, removeVertices
 
Methods inherited from class edu.uci.ics.jung.graph.impl.AbstractArchetypeGraph
addListener, copy, getEdgeConstraints, getVertexConstraints, newInstance, numEdges, numVertices, removeListener, toString
 
Methods inherited from class edu.uci.ics.jung.utils.UserData
addUserDatum, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.uci.ics.jung.graph.Graph
isDirected, removeEdge
 
Methods inherited from interface edu.uci.ics.jung.graph.ArchetypeGraph
addListener, copy, getEdgeConstraints, getEdges, getVertexConstraints, getVertices, newInstance, numEdges, numVertices, removeAllEdges, removeAllVertices, removeEdges, removeListener, removeVertices
 
Methods inherited from interface edu.uci.ics.jung.utils.UserDataContainer
addUserDatum, containsUserDatumKey, getUserDatum, getUserDatumCopyAction, getUserDatumKeyIterator, importUserData, removeUserDatum, setUserDatum
 

Field Detail

newNeighbors

public java.util.HashMap newNeighbors
Constructor Detail

BipartGraph

public BipartGraph(java.util.HashMap labels)
Method Detail

averageNumNeighbors

public double averageNumNeighbors()
Calculates avarage number of neighbors

Returns:

maxNumNeighbors

public double maxNumNeighbors()
Calculates the maximum number of neighbors in the graph

Returns:

countNeighborsClassesTest

public java.util.HashMap countNeighborsClassesTest(weka.core.FastVector items,
                                                   java.util.HashMap initial,
                                                   java.util.HashMap weightsMap,
                                                   java.util.HashMap nodes)
Counts the frequency of the categories of neighbors of an instance

Parameters:
items - - test set
initial - - initialization of test set
weightsMap - - the weights of edges in the graph
nodes - - nodes of the graph
Returns:
class frequencies (weighted by probabilities)

countNeighborsClassesMultiLabelTrain

public java.util.HashMap countNeighborsClassesMultiLabelTrain(weka.core.FastVector items,
                                                              java.util.HashMap initial,
                                                              java.util.HashMap weightsMap,
                                                              java.util.HashMap nodes)
Counts the frequency of the categories of neighbors of an instance (for binary classification)

Parameters:
items - - train set
initial - - initialization of test set
weightsMap - - the weights of edges in the graph
nodes - - nodes of the graph
Returns:
class frequencies

countNeighborsClassesMultiLabelTest

public java.util.HashMap countNeighborsClassesMultiLabelTest(weka.core.FastVector items,
                                                             int klasse,
                                                             java.util.HashMap initial,
                                                             java.util.HashMap weightsMap,
                                                             java.util.HashMap nodes)
Counts the frequency of the categories of neighbors of an instance (for binary classification)

Parameters:
items - - test set
initial - - initialization of test set
weightsMap - - the weights of edges in the graph
nodes - - nodes of the graph
Returns:
class frequencies (weighted by probabilities)

countNeighborsClassesTrain

public java.util.HashMap countNeighborsClassesTrain(weka.core.FastVector items,
                                                    java.util.HashMap initial,
                                                    java.util.HashMap weightsMap,
                                                    java.util.HashMap nodes)
Counts the frequency of the categories of neighbors of an instance

Parameters:
items - - train set
initial - - initialization of test set
weightsMap - - the weights of edges in the graph
nodes - - nodes of the graph
Returns:
class frequencies

getSingletons

public java.util.HashMap getSingletons(weka.core.FastVector items,
                                       java.util.HashMap nodes)
Get the nodes without any neighbors

Parameters:
items - - data set
nodes - - nodes of the graph
Returns:
singeltons

main

public static void main(java.lang.String[] args)