relational.classifier
Class ProbRNMultiLabel

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

public class ProbRNMultiLabel
extends RNCMultiLabel

Author:
cp Class contains the classifier PRN* and PRN* Geometric Mean (binary calssification), here we have to cope with the multilabel problem all the classes of an instance are considered
See Also:
Serialized Form

Field Summary
 double[] priors
           
 weka.core.Instances train
           
 
Fields inherited from class relational.classifier.RNCMultiLabel
maxProb, mostProbableClass, numClasses, numInClasses, numWithoutNeighbors
 
Constructor Summary
ProbRNMultiLabel()
           
 
Method Summary
 void buildClassifier(weka.core.Instances train)
           
 int classifyInstance(weka.core.Instance inst, double[] probs, int label, double th, java.util.HashMap probabilities)
          Classifies an instance according to the class probability distribution
 double[] distributionForInstance(edu.uci.ics.jung.graph.impl.SparseGraph graph, weka.core.Instance inst, java.util.HashMap id2ClassProb, int label, java.util.HashMap weights, java.lang.String type)
          computes class membership probability using Probabilistic Relational Classifier (binary classification)
 double[] distributionForInstanceGeometricMean(edu.uci.ics.jung.graph.impl.SparseGraph graph, weka.core.Instance inst, java.util.HashMap id2ClassProb, int label, java.util.HashMap weights, java.lang.String type)
          computes class membership probability using PRNGeometricMean (binary classification)
 
Methods inherited from class relational.classifier.RNCMultiLabel
classifyInstance, computeNumLabeledInstances, computePriors, distributionForInstance
 
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

train

public weka.core.Instances train

priors

public double[] priors
Constructor Detail

ProbRNMultiLabel

public ProbRNMultiLabel()
Method Detail

buildClassifier

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

distributionForInstance

public double[] distributionForInstance(edu.uci.ics.jung.graph.impl.SparseGraph graph,
                                        weka.core.Instance inst,
                                        java.util.HashMap id2ClassProb,
                                        int label,
                                        java.util.HashMap weights,
                                        java.lang.String type)
                                 throws java.lang.Exception
computes class membership probability using Probabilistic Relational Classifier (binary classification)

Parameters:
graph - - graph (jung)
inst - - instance to be classified
id2ClassProb - - initialization of test instances
label - - the category to be considered
weights - - the weights of the edges
Returns:
class probability distribution
Throws:
java.lang.Exception

distributionForInstanceGeometricMean

public double[] distributionForInstanceGeometricMean(edu.uci.ics.jung.graph.impl.SparseGraph graph,
                                                     weka.core.Instance inst,
                                                     java.util.HashMap id2ClassProb,
                                                     int label,
                                                     java.util.HashMap weights,
                                                     java.lang.String type)
                                              throws java.lang.Exception
computes class membership probability using PRNGeometricMean (binary classification)

Parameters:
graph - - graph (jung)
inst - - instance to be classified
id2ClassProb - - initialization of test instances
label - - the category to be considered
weights - - the weights of the edges
Returns:
class probability distribution
Throws:
java.lang.Exception

classifyInstance

public int classifyInstance(weka.core.Instance inst,
                            double[] probs,
                            int label,
                            double th,
                            java.util.HashMap probabilities)
                     throws java.lang.Exception
Classifies an instance according to the class probability distribution

Parameters:
inst - - instance to be classified
probs - - class probability distribution
label - - the category to be considered
th - - threshold
Returns:
the estimated category
Throws:
java.lang.Exception