permitted_dep_drop

pyoptex.utils.model.permitted_dep_drop(model, mode=None, dep=None, subset=None)[source]

Determines if the term specified by at idx of model can be dropped, given the other existing terms in the model, the mode, and the dependency matrix.

Parameters

modelnp.array(1d)

The terms in the current model.

modeNone or ‘weak’ or ‘strong’

The heredity mode.

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.

subsetnp.array(1d)

The subset of terms to validate, represented as indices in the model parameter. If None, all terms in the model are validated.

Returns

can_dropnp.array(bool)

Whether this term can be dropped given the dependencies and heredity mode.