term2strong

pyoptex.utils.model.term2strong(term, dep)[source]

Convert an existing model to its strong heredity variant according to the provided dependency matrix. A model is a strong heredity model if the for every term i, all its dependencies are also included in the model.

Parameters

termnp.array(1d)

The array with indices of the terms included in the initial model

depnp.array(2d)

A matrix of size (N, N) with N the total number of terms in the encoded model. Term i depends on term j if dep(i, j) = true.

Returns

strongnp.array(1d)

The strong heredity model based on the initial model.