relational.classifier
Class RelationalNeighborClassifier

java.lang.Object
  extended byweka.classifiers.Classifier
      extended byrelational.classifier.RelationalNeighborClassifier
All Implemented Interfaces:
java.lang.Cloneable, weka.core.OptionHandler, java.io.Serializable

public class RelationalNeighborClassifier
extends weka.classifiers.Classifier

Class contains the classifier Relational Neighbor Classifier

See Also:
Serialized Form

Field Summary
 java.util.HashMap labels
           
 double maxProb
           
 int mostProbableClass
           
 int numClasses
           
 int[] numInClasses
           
 int numWithoutNeighbors
           
 double[] priors
           
 
Constructor Summary
RelationalNeighborClassifier()
           
 
Method Summary
 void buildClassifier(weka.core.Instances instances)
           
 int classifyInstance(weka.core.Instance instance, edu.uci.ics.jung.graph.impl.SparseGraph graph, java.util.HashMap id2Label, java.util.HashMap weights, java.util.HashMap probabilities, java.lang.String type)
          Classifies an instance
 int computeNumLabeledInstances(edu.uci.ics.jung.graph.impl.SparseGraph g, java.util.Set neighbors, java.util.HashMap id2Label, java.lang.String type)
           
 double[] distributionForInstance(edu.uci.ics.jung.graph.impl.SparseGraph graph, weka.core.Instance instance, java.util.HashMap id2Label, java.util.HashMap weights, java.lang.String type)
          calculates the class membership probability using Relational Neighbor Classifier
 
Methods inherited from class weka.classifiers.Classifier
classifyInstance, debugTipText, distributionForInstance, forName, getDebug, getOptions, listOptions, makeCopies, makeCopy, setDebug, setOptions
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numClasses

public int numClasses

priors

public double[] priors

numWithoutNeighbors

public int numWithoutNeighbors

mostProbableClass

public int mostProbableClass

maxProb

public double maxProb

numInClasses

public int[] numInClasses

labels

public java.util.HashMap labels
Constructor Detail

RelationalNeighborClassifier

public RelationalNeighborClassifier()
Method Detail

buildClassifier

public void buildClassifier(weka.core.Instances instances)
                     throws java.lang.Exception
Throws:
java.lang.Exception

distributionForInstance

public double[] distributionForInstance(edu.uci.ics.jung.graph.impl.SparseGraph graph,
                                        weka.core.Instance instance,
                                        java.util.HashMap id2Label,
                                        java.util.HashMap weights,
                                        java.lang.String type)
                                 throws java.lang.Exception
calculates the class membership probability using Relational Neighbor Classifier

Parameters:
graph - - graph (jung)
instance - - instance to be classified
id2Label - - initialization of test instances
weights - - weights of the edges
type - - indicates the type of problem (heterogenous or homogenous)
Returns:
class probability distribution
Throws:
java.lang.Exception

computeNumLabeledInstances

public int computeNumLabeledInstances(edu.uci.ics.jung.graph.impl.SparseGraph g,
                                      java.util.Set neighbors,
                                      java.util.HashMap id2Label,
                                      java.lang.String type)

classifyInstance

public int classifyInstance(weka.core.Instance instance,
                            edu.uci.ics.jung.graph.impl.SparseGraph graph,
                            java.util.HashMap id2Label,
                            java.util.HashMap weights,
                            java.util.HashMap probabilities,
                            java.lang.String type)
                     throws java.lang.Exception
Classifies an instance

Parameters:
instance - - instance to be classified
graph - - graph (jung)
id2Label - - initialization of test instances
weights - - weights of the edges
type - - indicates the type of problem (heterogenous or homogenous)
Returns:
the estimated category
Throws:
java.lang.Exception