public class TestUtils
extends java.lang.Object
Constructor and Description |
---|
TestUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addNeighbours(java.util.List<Vector> dataset,
int numberOfNeighboursToAdd,
double radius)
Adds neighbours to each element in a data set.
|
static java.util.List<Vector> |
generate(int dimensions,
int datasetSize,
int maxValue)
Generate a data set.
|
public static java.util.List<Vector> generate(int dimensions, int datasetSize, int maxValue)
dimensions
- The number of dimensions of the vector.datasetSize
- The size of the data set.maxValue
- The maximum value of the coordinates of the vectors (a number between 0 and maxValue is chosen randomly).public static void addNeighbours(java.util.List<Vector> dataset, int numberOfNeighboursToAdd, double radius)
10 + 2 x 10 = 30
elements. Each
element is copied and moved slightly according to radius.dataset
- The data set.numberOfNeighboursToAdd
- The number of neighbours to add. E.g. If a data set has 10
elements and 2 neighbours are added, you end up with
10 + 2 x 10 = 30
elements.radius
- The radius used to create neigbours. In each dimension a
random number between -radius and +radius is added to the
current value.