encode_model

pyoptex.utils.model.encode_model(model, effect_types)[source]

Encodes the model according to the effect types. Each continuous variable is encoded as a single column, each categorical variable is encoded by creating n-1 columns (with n the number of categorical levels).

Parameters

modelnp.array(2d)

The initial model, before encoding

effect_typesnp.array(1d)

An array indicating whether the effect is continuous (=1) or categorical (with >1 levels).

Returns

modelnp.array(2d)

The newly encoded model.