def encode_attribute(att, desc, targ):
    """
    Encode the 'role' of an attribute in a model.

    This is an important function, since here resides the precise encoding.
    If this is changed, a whole lot of other things will change too. Since everything
    that relies on the encoding should refer here, everything should proceed normally.

    `Role` means:
        - Descriptive attribute (input)
        - Target attribute (output)
        - Missing attribute (not relevant to the model)
    """
    check_desc = att in desc
    check_targ = att in targ
    code_int = check_targ * 2 + check_desc - 1
    return code_int
