|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.cmu.minorthird.classify.Example
public class Example
An instance that is associated with a ClassLabel. Implements the Instance interface by delegating to a wrapped Instance, so subclasses just need to attach the right label construct.
| Field Summary | |
|---|---|
protected Instance |
instance
|
protected ClassLabel |
label
|
protected double |
weight
|
| Constructor Summary | |
|---|---|
Example(Instance instance,
ClassLabel label)
|
|
Example(Instance instance,
ClassLabel label,
double weight)
|
|
| Method Summary | |
|---|---|
Instance |
asInstance()
Return an unlabeled version of the example (an Instance) |
java.util.Iterator<Feature> |
binaryFeatureIterator()
Return an iterator over all binary features |
java.util.Iterator<Feature> |
featureIterator()
Return an iterator over all features |
ClassLabel |
getLabel()
get the label associated with the underlying object |
java.lang.Object |
getSource()
Get the underlying object |
java.lang.String |
getSubpopulationId()
Return the subpopulation Id of the instance. |
double |
getWeight()
Get the weight of this example. |
double |
getWeight(Feature f)
Get the weight assigned to a feature in the instance. |
java.util.Iterator<Feature> |
numericFeatureIterator()
Return an iterator over all numeric features |
int |
numFeatures()
Return the number of all features |
void |
setWeight(double newWeight)
Change the weight of this example. |
Viewer |
toGUI()
Create a viewer |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Instance instance
protected ClassLabel label
protected double weight
| Constructor Detail |
|---|
public Example(Instance instance,
ClassLabel label)
public Example(Instance instance,
ClassLabel label,
double weight)
| Method Detail |
|---|
public ClassLabel getLabel()
public final java.lang.Object getSource()
getSource in interface Instancepublic final double getWeight(Feature f)
getWeight in interface Instancepublic final java.util.Iterator<Feature> binaryFeatureIterator()
binaryFeatureIterator in interface Instancepublic final java.util.Iterator<Feature> numericFeatureIterator()
numericFeatureIterator in interface Instancepublic final java.util.Iterator<Feature> featureIterator()
featureIterator in interface Instancepublic final int numFeatures()
numFeatures in interface Instancepublic final double getWeight()
public final void setWeight(double newWeight)
public final java.lang.String getSubpopulationId()
getSubpopulationId in interface HasSubpopulationIdgetSubpopulationId in interface Instancepublic final Instance asInstance()
public java.lang.String toString()
toString in class java.lang.Objectpublic Viewer toGUI()
toGUI in interface Visible
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||