ClassificationResultsValidationContainer
public class ClassificationResultsContainer
extends java.lang.Object
SimpleClassifier
Modifier and Type | Field | Description |
---|---|---|
static int |
UNKNOWN_VALUE |
Value that is treated as unknown
|
Constructor | Description |
---|---|
ClassificationResultsContainer() |
Sole constructor
|
ClassificationResultsContainer(Classifier classifier,
MemoryContainer testContainer) |
Creates classification results container for given classifier and test memory container
|
Modifier and Type | Method | Description |
---|---|---|
ClassificationResult |
classify(int exampleIndex) |
Classifies example according to classification method that is
implemented in
SimpleClassifier classifier. |
java.util.Vector<ClassificationResult> |
classifyAllObjects() |
Clears all classification results stored in this container,
classify all objects from the test dataset, and stores new classification results.
|
Classifier |
getClassifier() |
Gets classifer
|
MemoryContainer |
getTestContainer() |
Gets test dataset
|
void |
setClassifier(Classifier classifier) |
Sets classifier.
|
void |
setTestContainer(MemoryContainer testContainer) |
Sets test dataset.
|
java.lang.String |
toString() |
Gets text form of this classification results container
|
void |
writeClassificationResults(java.lang.String fileName) |
Writes all classification results to a given file in a format similar
to the one used by JAMM.
|
public static final int UNKNOWN_VALUE
public ClassificationResultsContainer()
public ClassificationResultsContainer(Classifier classifier, MemoryContainer testContainer)
classifier
- classifier to be applied on examplestestContainer
- test memory container containing examples to classifypublic ClassificationResult classify(int exampleIndex)
SimpleClassifier
classifier.
This method stores also result of classification for
use with other methods that calculates statistics of
classificationexampleIndex
- index of the example to classifyjava.lang.IndexOutOfBoundsException
- when index is out of the test datasetjava.lang.NullPointerException
- when test dataset is not setpublic java.util.Vector<ClassificationResult> classifyAllObjects()
Vector
object with results of classification.java.lang.NullPointerException
- when test dataset is not set.public void writeClassificationResults(java.lang.String fileName) throws java.io.IOException
fileName
- path to filejava.io.IOException
- if file with given path can't be opened for writepublic java.lang.String toString()
toString
in class java.lang.Object
public Classifier getClassifier()
public MemoryContainer getTestContainer()
public void setClassifier(Classifier classifier)
classifyAllObjects()
is need after setting a new classifier.classifier
- classifier to setpublic void setTestContainer(MemoryContainer testContainer)
classifyAllObjects()
is need after setting a new test dataset.testContainer
- test dataset