sample_model_dep_onebyone

pyoptex.utils.model.sample_model_dep_onebyone(dep, size, n_samples=1, forced=None, mode=None)[source]

Sample a model given the dependency matrix of a fixed size. The terms are sampled one-by-one.

Parameters

depnp.array(2d)

The dependency matrix of size (N, N) with N the number of terms in the encoded model (output from Y2X). Term i depends on term j if dep(i, j) = true.

sizeint

The size of the model to sample.

n_samplesint

The number of samples to draw.

forcednp.array(1d)

A model which must be included at all times.

modeNone or ‘weak’ or ‘strong’

The heredity mode during sampling.

Returns

modelnp.array(2d)

The sampled model which is an array of integers of size (n_samples, size).