relational.classifier
Class RNCMultiLabel
java.lang.Object
weka.classifiers.Classifier
relational.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
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 |
numClasses
public int numClasses
numWithoutNeighbors
public int numWithoutNeighbors
mostProbableClass
public int mostProbableClass
maxProb
public double maxProb
numInClasses
public int[] numInClasses
priors
public double[] priors
RNCMultiLabel
public RNCMultiLabel()
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 classifiedlabel
- - category to be consideredid2Label
- - initialization of test instancesweights
- - weights of the edgestype
- - 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 consideredid2Label
- - initialization of test instancesweights
- - weights of the edgesth
- - thresholdprobabilities
- - the place where the class probability distribution is savedtype
- - indicates the type of problem (heterogenous or homogenous)
- Returns:
- the estimated category
- Throws:
java.lang.Exception