relational.types
Class BipartGraph
java.lang.Object
edu.uci.ics.jung.utils.UserData
edu.uci.ics.jung.graph.impl.AbstractArchetypeGraph
edu.uci.ics.jung.graph.impl.AbstractSparseGraph
edu.uci.ics.jung.graph.impl.SparseGraph
edu.uci.ics.jung.graph.impl.UndirectedSparseGraph
edu.uci.ics.jung.graph.impl.BipartiteGraph
relational.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 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 |
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 |
newNeighbors
public java.util.HashMap newNeighbors
BipartGraph
public BipartGraph(java.util.HashMap labels)
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 setinitial
- - initialization of test setweightsMap
- - the weights of edges in the graphnodes
- - 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 setinitial
- - initialization of test setweightsMap
- - the weights of edges in the graphnodes
- - 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 setinitial
- - initialization of test setweightsMap
- - the weights of edges in the graphnodes
- - 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 setinitial
- - initialization of test setweightsMap
- - the weights of edges in the graphnodes
- - 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 setnodes
- - nodes of the graph
- Returns:
- singeltons
main
public static void main(java.lang.String[] args)