|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.core.Instance
weka.core.SparseInstance
weka.core.SoftClassifiedSparseInstance
An Instance that has a probability distribution across class values. Particularly useful for EM using a SoftClassifier
Field Summary | |
protected double[] |
m_ClassDistribution
An array of probabilities giving the probability of each class for this Instance |
Fields inherited from class weka.core.SparseInstance |
m_Indices, m_NumAttributes |
Fields inherited from class weka.core.Instance |
m_AttValues, m_Dataset, m_Weight, MISSING_VALUE |
Constructor Summary | |
SoftClassifiedSparseInstance()
|
|
SoftClassifiedSparseInstance(SparseInstance instance)
Constructor that copies the attribute values and the weight from the given instance and gives SoftInstance random class probabilities that assign all probability (1) to the instance's given class |
|
SoftClassifiedSparseInstance(SparseInstance instance,
java.util.Random randomizer)
Constructor that copies the attribute values and the weight from the given instance and gives SoftInstance random class probabilities generated by the given randomizer. |
Method Summary | |
java.lang.Object |
copy()
Produces a shallow copy of this instance. |
double[] |
getClassDistribution()
Get the class distribution for this instance |
double |
getClassProbability(int classNum)
Return the probability the instance is in the given class |
protected double[] |
randomClassDistribution(java.util.Random randomizer)
Return a random class distribution |
void |
setClassDistribution(double[] dist)
Set the class distribution for this instance |
void |
setClassProbability(int classNum,
double prob)
Set the probability the instance is in the given class |
Methods inherited from class weka.core.SparseInstance |
attributeSparse, index, isMissing, locateIndex, main, mergeInstance, numAttributes, numValues, replaceMissingValues, setValue, setValueSparse, toDoubleArray, toString, value |
Methods inherited from class weka.core.Instance |
attribute, classAttribute, classIndex, classIsMissing, classValue, dataset, deleteAttributeAt, enumerateAttributes, equalHeaders, insertAttributeAt, isMissing, isMissingSparse, isMissingValue, missingValue, numClasses, setClassMissing, setClassValue, setClassValue, setDataset, setMissing, setMissing, setValue, setValue, setValue, setValueArray, setWeight, stringValue, stringValue, toString, toString, value, valueSparse, weight |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected double[] m_ClassDistribution
Constructor Detail |
public SoftClassifiedSparseInstance(SparseInstance instance, java.util.Random randomizer)
public SoftClassifiedSparseInstance(SparseInstance instance)
public SoftClassifiedSparseInstance()
Method Detail |
protected double[] randomClassDistribution(java.util.Random randomizer)
public double getClassProbability(int classNum)
getClassProbability
in interface SoftClassifiedInstance
public void setClassProbability(int classNum, double prob)
setClassProbability
in interface SoftClassifiedInstance
public double[] getClassDistribution()
getClassDistribution
in interface SoftClassifiedInstance
public void setClassDistribution(double[] dist) throws java.lang.Exception
setClassDistribution
in interface SoftClassifiedInstance
java.lang.Exception
public java.lang.Object copy()
new Instance(instance)
copy
in interface Copyable
copy
in class SparseInstance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |