public class GaussianGenerator
extends java.lang.Object
Class for generating toys subject to binary classification tasks, using Gaussian distribution.
Toys are sampled from 2 Gaussian distributions (one for the positive samples,
the other for the negtive samples). The positive samples have a mean of p on
each component, while the negative samples have a mean of -p on each
component. The number of dimension, the spacing p and the standard deviation
of the Gaussian can be adjusted.
Generated lists are shuffled.
Constructor and Description |
---|
GaussianGenerator()
Default constructor: p = 1, sigma = 1.0 , dimension = 3.
|
GaussianGenerator(int dimension)
Constructor specifying dimension.
|
GaussianGenerator(int dimension,
float p,
double sigma)
Constructor with all parameters
|
Modifier and Type | Method and Description |
---|---|
java.util.List<TrainingSample<double[]>> |
generateList(int number)
Generate a list of toys, with half of them being in the first class.
|
java.util.List<TrainingSample<double[]>> |
generateList(int positives,
int negatives)
Generate a list of toys with specified number of positive samples, and
negatives samples.
|
int |
getDimension()
Tells the dimension of the toys
|
float |
getP()
Tells the distance between classes
|
double |
getSigma()
Tells the standard deviation of the toys
|
void |
setDimension(int dimension)
Sets the dimension of the toys
|
void |
setP(float p)
Sets the distance between classes
|
void |
setSigma(double sigma)
Set the standard deviation of the toys
|
public GaussianGenerator()
public GaussianGenerator(int dimension)
dimension
- the dimension of the generated toys.public GaussianGenerator(int dimension, float p, double sigma)
dimension
- dimension of the toysp
- half distance between the 2 classessigma
- standard deviation of the Gaussianpublic java.util.List<TrainingSample<double[]>> generateList(int number)
number
- the number of toys to generatepublic java.util.List<TrainingSample<double[]>> generateList(int positives, int negatives)
positives
- the number of positive toysnegatives
- the number of negative toyspublic float getP()
public void setP(float p)
p
- the p to setpublic double getSigma()
public void setSigma(double sigma)
sigma
- the sigma to setpublic int getDimension()
public void setDimension(int dimension)
dimension
- the dimension to set