public class SimpleExample extends Example
Example
composed by a set of Representation
s.Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
logger |
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
|
boolean |
isCompatible(Example example)
Evaluates whether an example is compatible with this one, i.e., they have the
same structure in terms of Example type and representations
|
void |
manipulate(Manipulator manipulator)
Manipulate this example accordingly to the provided
manipulator |
String |
printExample(String... representations) |
void |
setRepresentations(HashMap<String,Representation> representations)
Sets the example representations
|
String |
toString() |
addLabel, duplicate, getClassificationLabels, getId, getLabels, getNumberOfClassificationLabels, getNumberOfRegressionLabels, getRegressionLabels, getRegressionValue, getRegressionValues, getTextualLabelPart, isExampleOf, setClassificationLabels, setLabels, setRegressionValues
public 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)
Example
setRepresentations
in class Example
representations
- to associate to this examplepublic Map<String,Representation> getRepresentations()
Example
getRepresentations
in class Example
public void addRepresentation(String representationName, Representation representation)
Example
addRepresentation
in class Example
representationName
- the identifier of the representation to be addedrepresentation
- the representation to be addedpublic int getNumberOfRepresentations()
Example
getNumberOfRepresentations
in class Example
public Representation getRepresentation(String representationName)
Example
representationName
getRepresentation
in class Example
representationName
- it is a representation identifierrepresentationName
public boolean equalsIgnoreLabels(SimpleExample example)
example
- public void manipulate(Manipulator manipulator)
Example
manipulator
manipulate
in class Example
manipulator
- the manipulatorpublic boolean isCompatible(Example example)
Example
isCompatible
in class Example
example
- the example to be compared with this oneCopyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.