relational.classifier
Class RNCMultiLabel

java.lang.Object
  extended byweka.classifiers.Classifier
      extended byrelational.classifier.RNCMultiLabel
All Implemented Interfaces:
java.lang.Cloneable, weka.core.OptionHandler, java.io.Serializable
Direct Known Subclasses:
ProbRNMultiLabel

public class RNCMultiLabel
extends weka.classifiers.Classifier

Author:
Christine Preisach Class contains the classifier Relational Neighbor Classifier (Multilabel Problem => binary classification)
See Also:
Serialized Form

Field Summary
 double maxProb
           
 int mostProbableClass
           
 int numClasses
           
 int[] numInClasses
           
 int numWithoutNeighbors
           
 double[] priors
           
 
Constructor Summary
RNCMultiLabel()
           
 
Method Summary
 void buildClassifier(weka.core.Instances train)
           
 int classifyInstance(weka.core.Instance inst, edu.uci.ics.jung.graph.impl.SparseGraph graph, int label, java.util.HashMap id2Label, java.util.HashMap weights, double th, java.util.HashMap probabilities, java.lang.String type)
          Classifies an instance
 int computeNumLabeledInstances(java.util.Set neighbors, java.util.HashMap id2Label, edu.uci.ics.jung.graph.impl.SparseGraph graph, java.lang.String type)
           
 double[] computePriors(weka.core.Instances instances)
           
 double[] distributionForInstance(edu.uci.ics.jung.graph.impl.SparseGraph graph, weka.core.Instance inst, int label, java.util.HashMap id2Label, java.util.HashMap weights, java.lang.String type)
          calculates the class membership probability using Relational Neighbor Classifier (binary classification)
 
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

numWithoutNeighbors

public int numWithoutNeighbors

mostProbableClass

public int mostProbableClass

maxProb

public double maxProb

numInClasses

public int[] numInClasses

priors

public double[] priors
Constructor Detail

RNCMultiLabel

public RNCMultiLabel()
Method Detail

computePriors

public double[] computePriors(weka.core.Instances instances)

buildClassifier

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

distributionForInstance

public double[] distributionForInstance(edu.uci.ics.jung.graph.impl.SparseGraph graph,
                                        weka.core.Instance inst,
                                        int label,
                                        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 (binary classification)

Parameters:
graph - - graph (jung)
inst - - instance to be classified
label - - category to be considered
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(java.util.Set neighbors,
                                      java.util.HashMap id2Label,
                                      edu.uci.ics.jung.graph.impl.SparseGraph graph,
                                      java.lang.String type)

classifyInstance

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

Parameters:
graph - - graph (jung)
label - - the category to be considered
id2Label - - initialization of test instances
weights - - weights of the edges
th - - threshold
probabilities - - the place where the class probability distribution is saved
type - - indicates the type of problem (heterogenous or homogenous)
Returns:
the estimated category
Throws:
java.lang.Exception