
Draw synthetic feature vectors from a trained feature texture model
Source:R/feature_texture.R
sample_feature_texture.RdSamples from the Gaussian copula: draws n_samples from
MVN(0, copula_cor), then transforms each feature through its inverse
marginal CDF. The result is centered and scaled to zero mean and unit
variance per feature, so the texture acts as noise that the structural
signal in run_single_iteration() provides the mean for.
Arguments
- feature_texture
An
iconic_feature_textureobject fromtrain_feature_texture().- n_samples
Number of synthetic samples to draw.
- n_features
Target number of features. If NULL, uses the number of features in the training data. If larger, additional features are drawn by sampling existing columns with replacement and adding independent noise. If smaller, the first n_features are used.
Examples
M <- matrix(rnorm(30 * 200), 30, 200) # 30 transcripts, 200 samples
ft <- train_feature_texture(M)
draws <- sample_feature_texture(ft, 500, n_features = 20)