jsat.utils
Class GridDataGenerator
- java.lang.Object
-
- jsat.utils.GridDataGenerator
-
public class GridDataGenerator extends java.lang.ObjectThis is a utility to generate data in a grid fashion. Each data point will belong to a different class. By default, the data is generated such that the classes are trivially separable.
All data points belong to a specific axis, and have noises added to them. For example, a 1 dimensional grid with 2 classes would have data points of the form 0+noise, and 1+noise. So long as the noise is less than 0.5, the data can be easily separated.
-
-
Constructor Summary
Constructors Constructor and Description GridDataGenerator()Creates a new grid data generator for a 2 x 5 with uniform noise in the range [-1/4, 1/4]GridDataGenerator(ContinuousDistribution noiseSource, int... dimensions)Creates a new Grid data generator, that can be queried for new data sets.GridDataGenerator(ContinuousDistribution noiseSource, java.util.Random rand, int... dimensions)Creates a new Grid data generator, that can be queried for new data sets.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description SimpleDataSetgenerateData(int samples)Generates a new data set.
-
-
-
Constructor Detail
-
GridDataGenerator
public GridDataGenerator(ContinuousDistribution noiseSource, java.util.Random rand, int... dimensions)
Creates a new Grid data generator, that can be queried for new data sets.- Parameters:
noiseSource- the distribution that describes the noise that will be added to each data point. If no noise is used, each data point would lie exactly on its local axis.rand- the source of randomness that the noise will usedimensions- an array describing how many groups there will be. The length of the array dictates the number of dimensions in the data set, each value describes how many axis of that dimensions to use. The total number of classes is the product of these values.- Throws:
java.lang.ArithmeticException- if one of the dimension values is not a positive value, or a zero number of dimensions is given
-
GridDataGenerator
public GridDataGenerator(ContinuousDistribution noiseSource, int... dimensions)
Creates a new Grid data generator, that can be queried for new data sets.- Parameters:
noiseSource- the distribution that describes the noise that will be added to each data point. If no noise is used, each data point would lie exactly on its local axis.dimensions- an array describing how many groups there will be. The length of the array dictates the number of dimensions in the data set, each value describes how many axis of that dimensions to use. The total number of classes is the product of these values.- Throws:
java.lang.ArithmeticException- if one of the dimension values is not a positive value, or a zero number of dimensions is given
-
GridDataGenerator
public GridDataGenerator()
Creates a new grid data generator for a 2 x 5 with uniform noise in the range [-1/4, 1/4]
-
-
Method Detail
-
generateData
public SimpleDataSet generateData(int samples)
Generates a new data set.- Parameters:
samples- the number of sample data points to create for each class in the data set.- Returns:
- A data set the contains the data points with matching class labels.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG