public abstract class Example extends Object implements Serializable
Constructor and Description |
---|
Example()
Initializes an empty example (0 classificationLabels and 0 regression values)
|
Modifier and Type | Method and Description |
---|---|
void |
addLabel(Label label)
Adds a label to the example
|
abstract void |
addRepresentation(String representationName,
Representation representation)
Adds a representation to this example
|
Example |
clone() |
boolean |
equals(Object example) |
HashSet<Label> |
getClassificationLabels() |
long |
getId()
Returns a unique identifier of the example.
|
Label[] |
getLabels()
Returns the classification classificationLabels of this example
|
int |
getNumberOfClassificationLabels()
Returns the number of classification classificationLabels whose this instance is a positive example
|
int |
getNumberOfRegressionLabels()
Returns the number of regression classificationLabels
|
abstract int |
getNumberOfRepresentations()
Returns the number of representations in which this example is modeled
|
NumericLabel[] |
getRegressionLabels()
Returns the classificationLabels of this example
|
Float |
getRegressionValue(Label property)
Returns the numeric value associated to a label
|
ArrayList<NumericLabel> |
getRegressionValues() |
abstract Representation |
getRepresentation(String representationName)
Returns the representation corresponding to
representationName |
abstract Map<String,Representation> |
getRepresentations()
Returns the example representations
|
protected String |
getTextualLabelPart() |
abstract Vector |
getZeroVector(String representationIdentifier) |
boolean |
isExampleOf(Label label)
Asserts whether this is a positive example for the input label or not
|
abstract void |
manipulate(Manipulator manipulator)
Manipulate this example accordingly to the provided
manipulator |
void |
setClassificationLabels(HashSet<Label> labels) |
void |
setLabels(Label[] labels)
Sets the example classificationLabels
|
void |
setRegressionValues(ArrayList<NumericLabel> regressionValues) |
abstract void |
setRepresentations(HashMap<String,Representation> representations)
Sets the example representations
|
public Example()
public long getId()
Note: initializing two identical examples will make them having two different IDs
public void setLabels(Label[] labels)
classificationLabels
- of which this instance is a positive examplepublic Label[] getLabels()
public NumericLabel[] getRegressionLabels()
public void addLabel(Label label)
label
- public int getNumberOfClassificationLabels()
public int getNumberOfRegressionLabels()
public boolean isExampleOf(Label label)
label
- true
if this is a positive example of the class
label
, false otherwisepublic Float getRegressionValue(Label property)
propertyName
- the regression label identifierpropertyName
or null if that label is not a NumericLabel or this example does not contain
that labelpublic HashSet<Label> getClassificationLabels()
public void setClassificationLabels(HashSet<Label> labels)
classificationLabels
- the classificationLabels to setpublic ArrayList<NumericLabel> getRegressionValues()
public void setRegressionValues(ArrayList<NumericLabel> regressionValues)
regressionValues
- the regressionValues to setprotected String getTextualLabelPart()
public abstract void setRepresentations(HashMap<String,Representation> representations)
representations
- to associate to this examplepublic abstract Map<String,Representation> getRepresentations()
public abstract void addRepresentation(String representationName, Representation representation)
representationName
- the identifier of the representation to be addedrepresentation
- the representation to be addedpublic abstract int getNumberOfRepresentations()
public abstract Representation getRepresentation(String representationName)
representationName
representationName
- it is a representation identifierrepresentationName
public abstract void manipulate(Manipulator manipulator)
manipulator
manipulator
- the manipulatorCopyright © 2015 Semantic Analytics Group @ Uniroma2. All rights reserved.