public abstract class AbstractDissimilarityClassifier extends Object implements DissimilarityClassifier
Constructor and Description |
---|
AbstractDissimilarityClassifier(int[] trainingLabels) |
Modifier and Type | Method and Description |
---|---|
double |
calculateTestAccuracy(int[] testLabels,
double[][] D)
Returns the test accuracy given the distances between test data points
and training data points as well as the true labels of the test data
points.
|
double |
calculateTrainingAccuracy(double[][] D)
Returns the training accuracy given the distance matrix on the training
set.
|
abstract int |
classifyTest(double[] distances)
Returns the supposed class label for some data point, that is not
part of the training set, based on its distances to the training data
set.
|
abstract int |
classifyTraining(int i,
double[] distances)
Returns the supposed class label for some data point in the
training set based on its distances to all training data points.
|
TreeSet<Integer> |
getLabels()
Returns the set of available class labels.
|
int[] |
getTrainingLabels()
Returns the correct class labels for all given training data
points.
|
public AbstractDissimilarityClassifier(int[] trainingLabels)
public int[] getTrainingLabels()
public TreeSet<Integer> getLabels()
public double calculateTrainingAccuracy(double[][] D)
DissimilarityClassifier
calculateTrainingAccuracy
in interface DissimilarityClassifier
D
- the distance matrix on the training set as described above.public double calculateTestAccuracy(int[] testLabels, double[][] D)
DissimilarityClassifier
calculateTestAccuracy
in interface DissimilarityClassifier
testLabels
- an array of size M containing the true labels
of each test data point.D
- the distance matrix on the training set as described
above.public abstract int classifyTraining(int i, double[] distances)
DissimilarityClassifier
classifyTraining
in interface DissimilarityClassifier
i
- the index of the data point that shall be classified in
the training set.distances
- the distances of the data point to all
training data points.public abstract int classifyTest(double[] distances)
DissimilarityClassifier
classifyTest
in interface DissimilarityClassifier
distances
- the distances of the data point to all
training data points.Copyright (C) 2016-2018 Benjamin Paaßen, AG Theoretical Computer Science, Centre of Excellence Cognitive Interaction Technology (CITEC), University of Bielefeld, licensed under the AGPL v. 3: http://openresearch.cit-ec.de/projects/tcs . This documentation is licensed under the conditions of CC-BY-SA 4.0: https://creativecommons.org/licenses/by-sa/4.0/