calpit.datasets
Synthetic data sets for trying out Cal-PIT.
The PyTorch data sets for training moved to calpit.nn.
Classes
Synthetic "tuning fork" data set with a heteroscedastic, bimodal conditional distribution. |
Module Contents
- class TuningFork(dims=3, lam=3, seed=299792458)[source]
Synthetic “tuning fork” data set with a heteroscedastic, bimodal conditional distribution.
The first feature is Bernoulli(0.2) and selects one of two branches; the remaining features are Uniform(-5, 5). The spread of the target grows with the second feature in one branch and shrinks in the other, and the branches separate (the fork) where the second feature is positive. The remaining features carry no information about the target.
- Parameters:
dims (int, optional) – The number of features, at least 2. Defaults to 3.
lam (float, optional) – The scale of the homoscedastic noise component. Defaults to 3.
seed (int, optional) – The default random seed for generate_data. Defaults to 299792458.
- generate_data(size, seed=None)[source]
Draws a sample of features and targets.
- Parameters:
size (int) – The number of samples.
seed (int, optional) – The random seed. Defaults to None, which uses the seed given at construction.
- Returns:
The features, shape (size, dims), and the targets, shape (size,), as a tuple (x_data, y_data).
- Return type:
tuple