public class SimpleExample extends Example
Example composed by a set of Representations.| Constructor and Description |
|---|
SimpleExample()
Initializes an empty example (0 labels and 0 representations)
|
SimpleExample(Label[] labels,
HashMap<String,Representation> representations)
Initializes a SimpleExample with the input representations and labels
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRepresentation(String representationName,
Representation representation)
Adds a representation to this example
|
boolean |
equals(Object example) |
boolean |
equalsIgnoreLabels(SimpleExample example)
Asserts whether this example and the input one have identical
representations, ignoring their labels
|
int |
getNumberOfRepresentations()
Returns the number of representations in which this example is modeled
|
Representation |
getRepresentation(String representationName)
Returns the representation corresponding to
representationName |
Map<String,Representation> |
getRepresentations()
Returns the example representations
|
Vector |
getZeroVector(String representationIdentifier) |
void |
normalize()
Normalize each normalizable representation of this example
|
String |
printExample(String... representations) |
void |
setRepresentations(HashMap<String,Representation> representations)
Sets the example representations
|
String |
toString() |
addLabel, clone, getClassificationLabels, getId, getLabels, getNumberOfClassificationLabels, getNumberOfRegressionLabels, getRegressionLabels, getRegressionValue, getRegressionValues, getTextualLabelPart, isExampleOf, setClassificationLabels, setLabels, setRegressionValuespublic SimpleExample()
public SimpleExample(Label[] labels, HashMap<String,Representation> representations)
labels - the classes whose this instance is a positive examplerepresentations - the various representations in which the instance is
representedpublic void setRepresentations(HashMap<String,Representation> representations)
representations - to associate to this examplepublic Map<String,Representation> getRepresentations()
public void addRepresentation(String representationName, Representation representation)
representationName - the identifier of the representation to be addedrepresentation - the representation to be addedpublic int getNumberOfRepresentations()
public Representation getRepresentation(String representationName)
representationNamerepresentationName - it is a representation identifierrepresentationNamepublic boolean equalsIgnoreLabels(SimpleExample example)
example - public void normalize()
public Vector getZeroVector(String representationIdentifier)
getZeroVector in class ExampleCopyright © 2014 Semantic Analytics Group @ Uniroma2. All rights reserved.