generate_data
generate_data
Generates data via a sparse latent variable model based on
Witten et al. 2009. The
generated data has two modalities with nexamples samples and nfeatx
and nfeaty variables, respectively. The activex and activey inputs
define the number of variables in the two data modalities that are
associated with a Gaussian latent variable.
Syntax
[X, Y, wX, wY] = generate_data(nexamples, nfeatx, nfeaty, activex, activey, noise)
Inputs
-
nexamples [int]
number of examples in generated data
-
nfeatx [int]
number of features in generated data \(\mathbf{X}\)
-
nfeaty [int]
number of features in generated data \(\mathbf{Y}\)
-
activex [int]
number of active features in generated data \(\mathbf{X}\) associated with the latent variable
-
activey [int]
number of active features in generated data \(\mathbf{Y}\) associated with the latent variable
-
noise [float]
noise level in the generative model
Outputs
-
X [2D numeric array]
generated data \(\mathbf{X}\) with
nexamplesrows andnfeatxcolumns -
Y [2D numeric array]
generated data \(\mathbf{Y}\) with
nexamplesrows andnfeatycolumns -
wX [numeric array]
true weights used to generate data \(\mathbf{X}\) from the latent variable, which has
activexnon-zero values -
wY [numeric array]
true weights used to generate data \(\mathbf{Y}\) from the latent variable, which has
activeynon-zero values
Examples
% Example 1
[X, Y, wX, wY] = generate_data(1000, 100, 100, 10, 10, 1);